/* ========== СТИЛИ ДЛЯ СТРАНИЦЫ КЕЙСОВ ========== */

.cases-section {
    padding: 80px 0;
    background: #f8fafc;
}

/* Сетка карточек */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* ========== КАРТОЧКИ КЕЙСОВ - ЕДИНЫЙ СТИЛЬ ========== */
.case-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 680px; /* Увеличена для двух кнопок */
    width: 100%;
}

.case-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Контейнер изображения - увеличенный */
.case-image {
    height: 300px;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
    transition: transform 0.5s ease;
    flex-shrink: 0;
}

.case-card:hover .case-image {
    transform: scale(1.05);
}

/* Контент карточки */
.case-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

/* Заголовок - фиксированной высоты для 2 строк */
.case-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1f2937;
    line-height: 1.4;
    height: 3.9rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Описание - фиксированной высоты для 4 строк */
.case-description {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 1rem;
    height: 6.4rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    flex-shrink: 0;
}

/* ===== КОНТЕЙНЕР ДЛЯ ДВУХ КНОПОК ===== */
.case-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    width: 100%;
}

/* Общие стили для обеих кнопок */
.case-details-btn,
.case-request-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-decoration: none;
    height: 52px;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Кнопка "Подробнее о кейсе" (синяя) */
.case-details-btn {
    background: linear-gradient(45deg, #2563eb, #3b82f6);
    color: white;
}

.case-details-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

/* Кнопка "Оставить заявку" (зеленая) */
.case-request-btn {
    background: linear-gradient(45deg, #10b981, #34d399);
    color: white;
}

.case-request-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.case-request-btn i,
.case-details-btn i {
    font-size: 1.1rem;
}

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.case-modal-overlay {
    z-index: 2002;
}

.case-modal-content {
    max-width: 800px;
    max-height: 85vh;
    background: white;
    width: 95%;
}

.case-modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Галерея изображений в модальном окне */
.case-modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.case-modal-gallery img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    border: 2px solid #e5e7eb;
}

.case-modal-gallery img:hover {
    transform: scale(1.05);
    border-color: #2563eb;
}

/* Мета информация в модальном окне */
.case-modal-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.case-modal-meta-item {
    text-align: center;
}

.case-modal-meta-item i {
    font-size: 1.5rem;
    color: #2563eb;
    margin-bottom: 8px;
}

.case-modal-meta-item h4 {
    color: #1f2937;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.case-modal-meta-item p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

/* Полное описание в модальном окне */
.case-modal-description {
    color: #4b5563;
    line-height: 1.8;
    margin: 20px 0;
    font-size: 0.95rem;
}

/* Результаты в модальном окне */
.case-modal-results {
    margin: 20px 0;
}

.case-modal-results h4 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.results-list {
    list-style: none;
    padding: 0;
}

.results-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    color: #4b5563;
}

.results-list li i {
    position: absolute;
    left: 0;
    color: #10b981;
}

/* Кнопка скачивания в модальном окне */
.case-modal-download {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: linear-gradient(45deg, #10b981, #34d399);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

/* Полноэкранное изображение */
.full-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.full-image-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
}

/* Загрузка */
.loading-message {
    text-align: center;
    grid-column: 1/-1;
    padding: 60px 20px;
}

.loading-message i {
    color: #2563eb;
    margin-bottom: 20px;
}

.loading-message p {
    color: #6b7280;
    font-size: 1.1rem;
}

/* ========== АДАПТИВНОСТЬ ========== */

/* Планшеты */
@media (max-width: 992px) {
    .cases-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 25px;
    }
    
    .case-card {
        height: 650px;
    }
    
    .case-image {
        height: 270px;
    }
    
    .case-title {
        font-size: 1.3rem;
        height: 3.6rem;
    }
    
    .case-buttons {
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .cases-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 15px;
    }
    
    .case-card {
        height: auto;
        min-height: 620px;
    }
    
    .case-image {
        height: 250px;
    }
    
    .case-title {
        height: auto;
        min-height: 3.5rem;
    }
    
    .case-description {
        height: auto;
        min-height: 6rem;
    }
    
    .case-buttons {
        gap: 10px;
    }
    
    .case-details-btn,
    .case-request-btn {
        padding: 12px 20px;
        height: 48px;
        font-size: 0.95rem;
    }
    
    .case-modal-meta {
        grid-template-columns: 1fr;
    }
    
    .case-modal-gallery {
        grid-template-columns: 1fr;
    }
}

/* Мобильные */
@media (max-width: 480px) {
    .cases-section {
        padding: 60px 0;
    }
    
    .case-card {
        min-height: 580px;
    }
    
    .case-image {
        height: 220px;
    }
    
    .case-content {
        padding: 20px;
    }
    
    .case-title {
        font-size: 1.2rem;
        margin-bottom: 12px;
        min-height: 3.3rem;
    }
    
    .case-description {
        font-size: 0.95rem;
        margin-bottom: 15px;
        min-height: 5.7rem;
    }
    
    .case-buttons {
        gap: 8px;
    }
    
    .case-details-btn,
    .case-request-btn {
        padding: 10px 16px;
        height: 44px;
        font-size: 0.9rem;
    }
}

/* Для больших экранов - кнопки в ряд */
@media (min-width: 1400px) {
    .case-buttons {
        flex-direction: row;
        gap: 15px;
    }
    
    .case-details-btn,
    .case-request-btn {
        width: calc(50% - 7.5px);
    }
}