/* portfolio.css - Стили для портфолио как на kim-darya.kz */

/* === Основные стили для сетки портфолио === */
#portfolio-grid {
    margin-top: 20px;
}

/* Контейнер для изображения (квадратный) */
.project-img-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    aspect-ratio: 1/1; /* КВАДРАТНОЕ соотношение (было 2/3) */
    margin-bottom: 25px;
}

.project-img-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Квадратное изображение */
.project-img-vertical {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.project-img-wrapper:hover .project-img-vertical {
    transform: scale(1.05);
}

/* Плейсхолдер для изображения */
.project-img-placeholder-vertical {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #e3e7f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a94a6;
    aspect-ratio: 1/1; /* КВАДРАТНОЕ соотношение */
}

/* Всплывающий оверлей при наведении */
.project-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); /* Более темный фон */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    text-align: center;
}

.project-img-wrapper:hover .project-hover-overlay {
    opacity: 1;
}

/* Контент внутри оверлея */
.hover-content {
    color: white;
    transform: translateY(15px);
    transition: transform 0.3s ease 0.1s;
    width: 100%;
    padding: 15px;
}

.project-img-wrapper:hover .hover-content {
    transform: translateY(0);
}

.hover-badge {
    display: inline-block;
    padding: 5px 12px;
    background: #e6a6bd; /* Изменено на e6a6bd */
    color: white;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 12px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hover-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: white;
    font-size: 16px;
    line-height: 1.3;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hover-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.hover-meta span {
    display: flex;
    align-items: center;
}

.hover-meta i {
    margin-right: 5px;
    font-size: 12px;
    color: #e6a6bd; /* Изменено на e6a6bd */
}

/* Кнопка в оверлее */
.hover-content .btn-light {
    background: #e6a6bd; /* Изменено на e6a6bd */
    border: none;
    color: #333;
    font-weight: 500;
    padding: 7px 18px;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-size: 13px;
}

.hover-content .btn-light:hover {
    background: #e6a6bd; /* Изменено на e6a6bd */
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* === Стили для модального окна === */
#projectModal .modal-dialog {
    max-width: 90%;
    max-height: 90vh;
    margin: 5vh auto;
}

#projectModal .modal-content {
    background: transparent;
    border: none;
    border-radius: 0;
}

/* Шапка модального окна */
#projectModal .modal-header {
    border: none;
    padding: 0;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
}

/* Кнопка закрытия (крестик) */
#projectModal .btn-close {
    background-image: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    background: #e6a6bd; /* Изменено на e6a6bd */
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    opacity: 0.9;
    transition: all 0.3s ease;
    position: relative;
}

#projectModal .btn-close:hover {
    background: #e6a6bd; /* Изменено на e6a6bd */
    opacity: 1;
    transform: scale(1.1);
}

#projectModal .btn-close span {
    display: block !important;
    color: #fff !important;
    font-family: Arial, sans-serif;
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
}

#projectModal .btn-close::before {
    display: none !important;
}

#projectModal .btn-close:focus {
    box-shadow: 0 0 0 3px rgba(230, 166, 189, 0.25); /* Изменено на e6a6bd */
}

/* Тело модального окна */
#projectModal .modal-body {
    padding: 0;
    overflow: hidden;
}

/* Главное изображение в модальном окне */
.project-main-image-container {
    position: relative;
    height: 80vh;
    overflow: hidden;
}

.modal-main-image {
    width: 100%;
    height: 80vh;
    object-fit: contain;
    display: block;
    position: absolute;
    inset: 0;
    cursor: pointer;
    will-change: transform;
}

.modal-main-image:hover {
    transform: scale(1.01);
}

/* Плейсхолдер в модальном окне */
.modal-image-placeholder {
    width: 100%;
    height: 80vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

/* Навигация в модальном окне (стрелочки) */
.modal-navigation {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    z-index: 1000;
}

.modal-nav-btn i {
    display: block !important;
    color: #fff !important;
    font-size: 1em;
    line-height: 1;
}

.modal-nav-btn::before {
    display: block;
    color: #fff !important;
    font-family: Arial, sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 0.8;
}

.modal-nav-prev::before {
    content: "\2039";
}

.modal-nav-next::before {
    content: "\203A";
}

.modal-nav-btn i {
    display: none !important;
}

.modal-nav-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #e6a6bd; /* Изменено на e6a6bd */
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.modal-nav-btn:hover {
    background: #e6a6bd; /* Изменено на e6a6bd */
    opacity: 0.9;
    transform: scale(1.1);
}

.modal-nav-counter {
    color: white;
    background: #e6a6bd; /* Изменено на e6a6bd */
    padding: 6px 15px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    min-width: 70px;
    text-align: center;
    backdrop-filter: blur(5px);
}

/* Анимации */
@keyframes portfolioImageEnter {
    from {
        opacity: 0;
        transform: translateX(18px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.modal-main-image-enter {
    animation: portfolioImageEnter 0.45s ease-out both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-img-wrapper {
    animation: fadeIn 0.5s ease forwards;
}

/* ========== АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ ========== */

/* Большие планшеты и маленькие десктопы (992px и меньше) */
@media (max-width: 992px) {
    #projectModal .modal-dialog {
        max-width: 95%;
        margin: 2vh auto;
    }
    
    .modal-main-image {
        height: 70vh;
    }
    
    .modal-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }
    
    .modal-nav-counter {
        font-size: 12px;
        padding: 5px 12px;
        min-width: 60px;
    }
    
    #projectModal .btn-close {
        width: 34px;
        height: 34px;
        top: 12px;
        right: 12px;
    }
    
    #projectModal .btn-close::before {
        font-size: 20px;
    }
}

/* Планшеты и большие телефоны (768px и меньше) */
@media (max-width: 768px) {
    .project-img-wrapper {
        margin-bottom: 20px;
        border-radius: 6px;
    }
    
    .project-hover-overlay {
        padding: 15px;
    }
    
    .hover-title {
        font-size: 15px;
        min-height: 36px;
    }
    
    .hover-meta {
        font-size: 12px;
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .hover-content .btn-light {
        padding: 6px 15px;
        font-size: 12px;
    }
    
    .hover-badge {
        font-size: 10px;
        padding: 4px 10px;
        margin-bottom: 10px;
    }
    
    /* Модальное окно на мобильных */
    #projectModal .modal-header {
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 2000;
    }

    #projectModal .modal-dialog {
        max-width: 100%;
        margin: 0;
        height: 100vh;
        width: 100%;
    }
    
    .project-main-image-container {
        height: 100vh;
    }

    .modal-main-image {
        height: 100vh;
        object-fit: contain;
    }
    
    .modal-navigation {
        bottom: 15px;
        gap: 20px;
    }
    
    .modal-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    
    .modal-nav-counter {
        font-size: 11px;
        padding: 5px 10px;
        min-width: 55px;
    }
    
    #projectModal .btn-close {
        width: 32px;
        height: 32px;
        top: 10px;
        right: 10px;
    }
    
    #projectModal .btn-close::before {
        font-size: 18px;
    }
}

/* Телефоны (576px и меньше) */
@media (max-width: 576px) {
    #portfolio-grid {
        margin-top: 15px;
    }
    
    .project-img-wrapper {
        margin-bottom: 15px;
        border-radius: 5px;
    }
    
    .hover-title {
        font-size: 14px;
        min-height: 32px;
        margin-bottom: 8px;
    }
    
    .hover-meta {
        flex-direction: column;
        gap: 6px;
        margin-bottom: 10px;
        font-size: 11px;
    }
    
    .hover-content {
        padding: 12px;
    }
    
    .project-hover-overlay {
        padding: 12px;
    }
    
    .hover-content .btn-light {
        padding: 5px 12px;
        font-size: 11px;
        margin-top: 8px !important;
    }
    
    .hover-badge {
        font-size: 9px;
        padding: 3px 8px;
        margin-bottom: 8px;
    }
    
    /* Навигация по центру фотографии на мобильных */
    .modal-navigation {
        top: 50%;
        bottom: auto;
        left: 0;
        right: 0;
        transform: translateY(-50%);
        justify-content: space-between;
        gap: 0;
        padding: 0 12px;
        pointer-events: none;
    }
    
    .modal-nav-btn {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        background: rgba(212, 138, 166, 0.95);
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
        pointer-events: auto;
    }
    
    .modal-nav-counter {
        font-size: 10px;
        padding: 4px 8px;
        min-width: 50px;
    }
    
    #projectModal .btn-close {
        width: 30px;
        height: 30px;
        top: 8px;
        right: 8px;
    }
    
    #projectModal .btn-close::before {
        font-size: 16px;
    }
}

/* Очень маленькие телефоны (400px и меньше) */
@media (max-width: 400px) {
    .project-img-wrapper {
        margin-bottom: 12px;
    }
    
    .hover-title {
        font-size: 13px;
        min-height: 30px;
    }
    
    .hover-meta {
        font-size: 10px;
    }
    
    .hover-content .btn-light {
        padding: 4px 10px;
        font-size: 10px;
        margin-top: 6px !important;
    }
    
    .modal-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .modal-nav-counter {
        font-size: 9px;
        padding: 3px 6px;
        min-width: 45px;
    }
    
    #projectModal .btn-close {
        width: 28px;
        height: 28px;
        top: 6px;
        right: 6px;
    }
    
    #projectModal .btn-close::before {
        font-size: 15px;
    }
}

/* Ландшафтная ориентация на телефонах */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-main-image {
        height: 90vh;
        object-fit: contain;
    }
    
    .modal-navigation {
        bottom: 10px;
    }
    
    #projectModal .btn-close {
        top: 5px;
        right: 5px;
    }
}

/* Специальный медиа-запрос для очень больших экранов */
@media (min-width: 1400px) {
    #portfolio-grid {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .project-img-wrapper {
        margin-bottom: 30px;
    }
}

/* Эффект загрузки */
.project-img-vertical.loading {
    opacity: 0.7;
    filter: blur(5px);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.project-img-vertical.loaded {
    opacity: 1;
    filter: blur(0);
}