/* static/css/project.css */

/* ========== СТРАНИЦА ПРОЕКТА ========== */

/* Главный контейнер изображения */
.main-image-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow);
    aspect-ratio: 16/9;
    transition: all 0.4s ease;
    cursor: pointer;
}

.main-image-container:hover {
    transform: scale(1.02);
    border-color: var(--color-primary);
    box-shadow: 0 10px 30px rgba(13, 110, 253, 0.4);
}

.project-page .main-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    transition: transform 0.5s ease !important;
}

.main-image-container:hover .project-page .main-image,
.main-image-container:hover .main-image {
    transform: scale(1.05);
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease, transform 0.5s ease;
    background: transparent;
}

.main-image.no-image {
    object-fit: contain;
    opacity: 0.7;
    padding: 2rem;
}

/* Индикатор загрузки */
.image-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 5;
}

.main-image-container.loading .image-loader {
    opacity: 1;
}

.main-image-container.loading .main-image {
    opacity: 0.3;
}

.main-image-container.loading:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Галерея превью */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.gallery-item {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-slow);
    border: 2px solid transparent;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    box-shadow: var(--shadow-sm);
}

.gallery-item.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.3);
}

.gallery-item:hover {
    transform: translateY(-3px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-hover);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* Характеристики проекта */
.project-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
}

.spec-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-item:hover {
    transform: translateY(-5px);
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-hover);
}

.spec-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.spec-item:hover .spec-icon {
    background: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

.spec-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    margin: 0.5rem 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.spec-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Описание проекта */
.project-description {
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
}

.project-description h3 {
    color: white;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.project-description h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background: var(--color-primary);
}

.project-description h4 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.project-description p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Бейдж типа проекта */
.project-type-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--color-primary);
    color: white;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 10px rgba(13, 110, 253, 0.3);
    margin: 1rem 0;
}

/* Значение стоимости */
.cost-value {
    font-size: 1.6rem !important;
    color: var(--color-primary) !important;
    font-weight: 800 !important;
    text-align: left !important;
    line-height: 1.2 !important;
    margin: 1rem 0 !important;
    letter-spacing: 1px !important;
    display: block !important;
    width: 100% !important;
}

/* Лайтбокс */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--color-primary);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.lightbox-close:hover {
    background: var(--color-primary);
    transform: scale(1.1);
    border-color: var(--color-primary);
}

/* Заголовок проекта */
.major h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Кнопки */
.button.primary,
.button.alt {
    min-width: 200px;
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

/* Адаптация для планшетов */
@media (max-width: 980px) {
    .project-specs {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Адаптация для мобильных */
@media (max-width: 736px) {
    .main-image-container {
        aspect-ratio: 4/3;
    }
    
    .project-specs {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }
    
    .spec-item {
        padding: 1rem;
    }
    
    .spec-value {
        font-size: 1.5rem;
    }
    
    .spec-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .project-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .cost-value {
        font-size: 1.5rem !important;
    }
    
    .project-description h3 {
        font-size: 1.5rem;
    }
    
    .project-description p {
        font-size: 1rem;
    }
    
    .major h1 {
        font-size: 1.8rem;
    }
    
    .button.primary,
    .button.alt {
        min-width: 100%;
    }
}

/* Адаптация для маленьких телефонов */
@media (max-width: 480px) {
    .main-image-container {
        aspect-ratio: 3/4;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        top: 10px;
        right: 15px;
    }
}