/* cases.css - Стили для блока кейсов */

.cases-section {
    padding: 120px 0;
    background: linear-gradient(135deg, #0a0a0a 0%, #111111 50%, #0a0a0a 100%);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    color: #ffffff;
}

/* Анимированный фон */
.cases-section .animated-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cases-section .floating-shape {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 152, 70, 0.08) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite;
}

.cases-section .shape-1 {
    width: 400px;
    height: 400px;
    top: 10%;
    right: 5%;
    animation-delay: 0s;
}

.cases-section .shape-2 {
    width: 300px;
    height: 300px;
    bottom: 20%;
    left: 5%;
    animation-delay: 3s;
}

.cases-section .shape-3 {
    width: 250px;
    height: 250px;
    top: 50%;
    right: 15%;
    animation-delay: 6s;
}

.cases-section .pulse-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #009846;
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
}

.cases-section .dot-1 { top: 30%; left: 15%; animation-delay: 1s; }
.cases-section .dot-2 { bottom: 40%; right: 20%; animation-delay: 2s; }

/* Заголовок секции */
.cases-section .section-header {
    text-align: center;
    margin-bottom: 60px;
}

.cases-section .section-title {
    margin-bottom: 20px;
    line-height: 1.1;
}

.cases-section .title-line {
    display: block;
    line-height: 1.2;
    margin-bottom: 10px;
}

.cases-section .title-line.accent {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff, #009846);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Unbounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -0.02em;
    display: block;
}

.cases-section .section-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Фильтры */
.cases-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 50px;
    position: relative;
    z-index: 10;
}

.filter-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 152, 70, 0.2), transparent);
    transition: left 0.5s ease;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    color: #ffffff;
    border-color: rgba(0, 152, 70, 0.5);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #009846, #00a84d);
    color: white;
    border-color: #009846;
    box-shadow: 0 5px 15px rgba(0, 152, 70, 0.3);
}

/* Сетка кейсов */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.case-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
}

.case-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.case-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 152, 70, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.case-card.hidden {
    display: none;
}

/* Изображение кейса */
.case-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.case-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.case-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.case-card:hover .case-overlay {
    opacity: 1;
}

.case-stats {
    display: flex;
    gap: 20px;
    width: 100%;
}

.stat {
    text-align: center;
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #009846;
    margin-bottom: 5px;
}

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

/* Контент кейса */
.case-content {
    padding: 30px;
}

.case-client {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.client-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
}

.client-industry {
    background: rgba(0, 152, 70, 0.2);
    color: #009846;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(0, 152, 70, 0.3);
}

.case-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #ffffff;
    line-height: 1.3;
}

.case-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.case-results {
    margin-bottom: 25px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.result-item i {
    color: #009846;
    font-size: 1rem;
}

.case-details-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: transparent;
    border: 2px solid #009846;
    border-radius: 10px;
    color: #009846;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
}

.case-details-btn:hover {
    background: #009846;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 152, 70, 0.3);
}

/* Кнопка показать еще */
.cases-more {
    text-align: center;
    margin-bottom: 80px;
}

.show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.show-more-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Блок с логотипами клиентов */
.clients-showcase {
    margin-top: 80px;
    position: relative;
}

.clients-header {
    text-align: center;
    margin-bottom: 40px;
}

.clients-header h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #ffffff;
}

.clients-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.clients-scroll {
    overflow: hidden;
    position: relative;
    padding: 20px 0;
}

.clients-track {
    display: flex;
    gap: 40px;
    animation: scrollClients 30s linear infinite;
    padding: 0 20px;
}

.client-logo-item {
    flex-shrink: 0;
    width: 120px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.client-logo-item:hover {
    border-color: rgba(0, 152, 70, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.client-logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(1) brightness(2);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.client-logo-item:hover img {
    filter: grayscale(0) brightness(1);
    opacity: 1;
}

@keyframes scrollClients {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-120px * 8 - 40px * 7));
    }
}

/* Модальное окно */
.case-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
}

.case-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #222222 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #009846;
    transform: rotate(90deg);
}

.modal-content {
    padding: 40px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .cases-section .title-line.accent {
        font-size: 3rem;
    }
    
    .cases-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .cases-section {
        padding: 80px 0;
        min-height: auto;
    }
    
    .cases-section .title-line.accent {
        font-size: 2.5rem;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
    }
    
    .cases-filters {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
    
    .cases-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .case-content {
        padding: 25px;
    }
    
    .case-title {
        font-size: 1.3rem;
    }
    
    .modal-container {
        width: 95%;
        margin: 20px;
    }
    
    .modal-content {
        padding: 30px 25px;
    }
    
    .clients-track {
        gap: 25px;
    }
    
    .client-logo-item {
        width: 100px;
        height: 50px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .cases-section .title-line.accent {
        font-size: 2rem;
    }
    
    .cases-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        margin-bottom: 30px;
    }
    
    .filter-btn {
        flex-shrink: 0;
    }
    
    .case-image {
        height: 200px;
    }
    
    .case-content {
        padding: 20px;
    }
    
    .case-client {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .case-title {
        font-size: 1.2rem;
    }
    
    .modal-content {
        padding: 25px 20px;
    }
    
    .clients-header h3 {
        font-size: 1.6rem;
    }
}

/* Ландшафтная ориентация */
@media (max-width: 768px) and (orientation: landscape) {
    .cases-section {
        padding: 60px 0;
    }
    
    .cases-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .case-image {
        height: 180px;
    }
    
    .case-content {
        padding: 20px 15px;
    }
}

/* Анимации для появления */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.case-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* Улучшения для производительности */
.case-card {
    transform: translateZ(0);
    backface-visibility: hidden;
}

.client-logo-item {
    transform: translateZ(0);
}

/* Дополнительные стили для модального окна */
.case-modal-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.case-modal-client {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.modal-client-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    flex-shrink: 0;
}

.modal-client-industry {
    background: rgba(0, 152, 70, 0.2);
    color: #009846;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(0, 152, 70, 0.3);
    display: inline-block;
    margin-bottom: 10px;
}

.modal-case-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin: 0;
}

.case-meta {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.meta-item i {
    color: #009846;
}

.case-modal-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.case-modal-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.case-modal-content h3 i {
    color: #009846;
}

.case-modal-content p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 1rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.result-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.result-card:hover {
    border-color: rgba(0, 152, 70, 0.3);
    transform: translateY(-2px);
}

.result-card i {
    color: #009846;
    font-size: 1.1rem;
}

.result-card span {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-tag {
    background: rgba(0, 152, 70, 0.1);
    color: #009846;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(0, 152, 70, 0.3);
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
    .modal-case-title {
        font-size: 1.4rem;
    }
    
    .case-modal-client {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-client-logo {
        align-self: center;
    }
    
    .case-meta {
        justify-content: center;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* Исправления для cases.css */

/* Убедимся что карточки изначально скрыты для анимации */
.case-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.case-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Стили для тултипов клиентов */
.client-name-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 100;
}

.client-logo-item:hover .client-name-tooltip {
    opacity: 1;
}

/* Анимация бегущей строки */
@keyframes scrollClients {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-120px * 8 - 40px * 7));
    }
}

/* Стили для модального окна */
.modal-client-info {
    flex: 1;
}

/* Улучшения для фильтров на мобильных */
@media (max-width: 768px) {
    .cases-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 15px;
        margin-bottom: 30px;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-btn {
        flex-shrink: 0;
    }
}

/* Убедимся что все элементы кликабельны */
.case-details-btn,
.filter-btn,
.show-more-btn {
    cursor: pointer;
}

/* Fallback для отсутствующих изображений */
.client-logo-item img[src=""],
.client-logo-item img:not([src]) {
    display: none;
}

.client-logo-item:has(img[style*="display: none"]) {
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    text-align: center;
    padding: 10px;
}

/* Улучшения для скролла в модальном окне */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: #009846 rgba(255, 255, 255, 0.1);
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #009846;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #00a84d;
}