/**
 * Стили для страницы проекта
 */

/* ===== Детальная страница проекта ===== */
.project-hero {
    background: transparent;
    padding: 0;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.project-hero-content {
    width: 100%;
}

.back-link-hero {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 0;
}

.back-link-hero:hover {
    color: var(--primary-hover);
    transform: translateX(-4px);
}

.back-link-hero svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    stroke: currentColor;
}

.project-hero-image-small {
    max-width: 400px;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-hero-image-small:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.project-image-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    max-height: 300px;
    object-fit: cover;
}

.image-zoom-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-hero-image-small:hover .image-zoom-hint {
    opacity: 1;
}

.image-zoom-hint svg {
    width: 16px;
    height: 16px;
}

/* Модальное окно для просмотра изображения */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.image-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10000;
}

.image-modal-close:hover,
.image-modal-close:focus {
    color: #fff;
    text-decoration: none;
}

.project-hero-info {
    text-align: left;
    max-width: 900px;
    margin: 0 auto;
}

.project-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.2;
}

/* Хлебные крошки и действия проекта */
.project-breadcrumbs-actions {
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.project-breadcrumbs ol li a {
    transition: color 0.2s ease;
}

.project-breadcrumbs ol li a:hover {
    color: var(--color-primary);
}

.project-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.project-share-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-likes-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-likes-buttons .meta-link-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: 0.875rem;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    color: #64748b;
}

.project-likes-buttons .meta-link-btn:hover {
    background: transparent;
    opacity: 0.7;
    color: var(--primary-color);
}

.project-likes-buttons .meta-link-btn svg,
.project-likes-buttons .meta-link-btn .icon {
    width: 18px;
    height: 18px;
}

.project-likes-buttons .meta-like-btn.active,
.project-likes-buttons .meta-dislike-btn.active {
    border: none;
    background: transparent;
}

.project-hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.project-hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-detail-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    max-width: 1140px;
    margin: 0 auto;
    align-items: start;
}

.project-detail-main {
    min-width: 0;
}

.project-detail {
    max-width: 900px;
    margin: 0 auto;
}

.project-sidebar {
    position: sticky;
    top: 100px;
    max-height: none;
    overflow-y: visible;
    width: 100%;
    min-width: 0;
}

/* Стили для related-projects-section внутри сайдбара */
.project-sidebar .related-projects-section {
    width: 100%;
    min-width: 0;
}

.project-sidebar .related-projects-list {
    width: 100%;
    min-width: 0;
}

.project-sidebar .related-project-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.project-sidebar .related-project-content {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.project-sidebar .related-project-content h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.project-sidebar .related-project-content p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.project-sidebar .related-project-image {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.project-sidebar .related-project-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

.project-tech-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: transparent;
    border-radius: 16px;
    border: none;
}

.project-tech-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-tech-section h2 svg {
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
    stroke: var(--primary-color);
}

.project-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tech-tag {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background: white;
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    transition: all 0.2s ease;
}

.tech-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.project-description-section {
    margin-bottom: 3rem;
}

.project-description-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-description-section h2 svg {
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
    stroke: var(--primary-color);
}

.project-description {
    line-height: 1.8;
    color: var(--text-color);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* Блок кода */
.project-code-section {
    margin-bottom: 3rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.code-language-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-language-badge svg {
    width: 16px;
    height: 16px;
}

.code-actions {
    display: flex;
    gap: 0.5rem;
}

.code-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.code-action-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.code-action-btn svg {
    width: 14px;
    height: 14px;
}

.code-action-btn-icon-only {
    padding: 0.5rem;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}

.code-block-wrapper {
    position: relative;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 0 0 12px 12px;
}

.code-block {
    margin: 0;
    padding: 0;
    background: #ffffff;
    font-family: 'Courier New', 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.code-block code {
    display: block;
    padding: 0;
    color: #24292e;
    font-family: inherit;
    font-size: inherit;
    white-space: pre;
    word-wrap: normal;
    position: relative;
}

/* Стили для highlight.js с номерами строк */
.code-block-wrapper {
    position: relative;
    display: flex;
    background: #ffffff;
}

.code-block-wrapper::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3.5rem;
    background: #f6f8fa;
    border-right: 1px solid #e1e4e8;
    z-index: 0;
    pointer-events: none;
}

.code-block-wrapper .hljs {
    background: #ffffff !important;
    color: #24292e !important;
    padding: 1.5rem 0 !important;
    margin: 0;
    width: 100%;
    display: block;
}

.code-block-wrapper .hljs .code-line-row {
    display: flex;
    min-height: 1.6em;
    white-space: pre;
    margin: 0;
    line-height: 1.6;
}

.code-block-wrapper .hljs .line-number {
    display: inline-block;
    width: 3.5rem;
    text-align: right;
    padding-right: 1rem;
    padding-left: 0;
    color: #6a737d;
    font-size: 0.8125rem;
    user-select: none;
    line-height: 1.6;
    font-weight: normal;
    background: #f6f8fa;
    flex-shrink: 0;
    border-right: 1px solid #e1e4e8;
}

.code-block-wrapper .hljs .code-line-content {
    display: inline-block;
    padding-left: 1rem;
    padding-right: 1.5rem;
    flex: 1;
    white-space: pre;
    overflow-x: auto;
}

/* Превью кода */
.code-preview-section {
    margin-top: 1rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.code-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
}

.code-preview-header svg {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
}

.code-preview-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-preview-close:hover {
    background: #f1f5f9;
}

.code-preview-close svg {
    width: 16px;
    height: 16px;
    margin: 0;
}

.code-preview-content {
    padding: 1rem;
    background: #ffffff;
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
}

.preview-info {
    background: #f8fafc;
    border-radius: 8px;
}

.project-meta-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.project-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.project-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: #64748b;
}

.meta-text-only {
    color: #64748b;
}

.project-meta-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.meta-text {
    color: #64748b;
}

.meta-text strong {
    color: var(--text-color);
    font-weight: 600;
}

.meta-link,
.meta-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.meta-link:hover,
.meta-link-btn:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.meta-link:hover svg,
.meta-link-btn:hover svg {
    fill: var(--primary-color);
    stroke: var(--primary-color);
    color: var(--primary-color);
}

.meta-link-btn svg,
.meta-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.meta-link-btn .like-icon,
.meta-link-btn .dislike-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s ease;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.meta-link:active,
.meta-link-btn:active {
    color: var(--primary-hover);
}

.meta-link:active svg,
.meta-link-btn:active svg {
    fill: var(--primary-hover);
    stroke: var(--primary-hover);
    color: var(--primary-hover);
}

.meta-like-btn.active,
.meta-dislike-btn.active {
    color: var(--primary-color);
}

.meta-like-btn.active svg,
.meta-dislike-btn.active svg {
    fill: var(--primary-color);
    stroke: var(--primary-color);
    color: var(--primary-color);
}

.meta-like-btn.active {
    color: #10b981;
}

.meta-like-btn.active .like-icon {
    filter: brightness(0.9);
    transform: scale(1.2);
}

.meta-dislike-btn.active {
    color: #ef4444;
}

.meta-dislike-btn.active .dislike-icon {
    filter: brightness(0.9);
    transform: scale(1.2);
}

.like-icon,
.dislike-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s ease;
}

.meta-link-btn:hover .like-icon,
.meta-link-btn:hover .dislike-icon {
    transform: scale(1.1);
}

.related-projects-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.related-projects-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-projects-section h2 svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-color);
    stroke: var(--primary-color);
}

.related-projects-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.related-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.related-project-card {
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.related-project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.related-project-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: var(--bg-light);
}

.related-project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-project-card:hover .related-project-image img {
    transform: scale(1.05);
}

.related-project-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    height: 140px;
}

.related-project-image-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

.related-project-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.related-project-content h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.3;
}

.related-project-content p {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
    -webkit-line-clamp: none;
    -webkit-box-orient: initial;
    overflow: visible;
}

.related-project-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: auto;
}

.related-project-date svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

@media (max-width: 1024px) {
    .project-detail-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .project-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    
    .related-projects-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .project-hero-title {
        font-size: 2rem;
    }
    
    .project-hero-subtitle {
        font-size: 1.1rem;
    }
    
    .project-breadcrumbs-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .project-breadcrumbs ol {
        font-size: 0.8125rem;
    }
    
    .project-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .project-share-buttons {
        gap: 0.5rem;
    }
    
    .share-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .project-hero-image-small {
        max-width: 100%;
        margin: 1.5rem 0;
    }
    
    .project-image-thumbnail {
        max-height: 250px;
    }
    
    .image-modal-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
    
    .image-modal-content {
        max-width: 95%;
        max-height: 85vh;
    }
    
    .project-hero-actions {
        flex-direction: column;
    }
    
    .btn-hero {
        width: 100%;
        justify-content: center;
    }
    
    .project-meta-section {
        grid-template-columns: 1fr;
    }
    
    .related-projects-list {
        grid-template-columns: 1fr;
    }
    
    .code-block-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .code-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .code-block-wrapper {
        max-height: 400px;
    }
    
    .code-block-wrapper .hljs {
        padding-left: 2.5rem !important;
        font-size: 0.75rem !important;
    }
    
    .code-block-wrapper .hljs::before {
        width: 2rem;
    }
    
    .code-block-wrapper .hljs .code-line {
        padding-left: 2.5rem;
    }
    
    .code-block-wrapper .hljs .line-number {
        width: 2rem;
        font-size: 0.75rem;
    }
}

