/* ========================================
   🎴 АНИМИРОВАННЫЕ 3D КАРТОЧКИ
   ========================================
   
   Эффектные 3D карточки с:
   - Skew эффектом
   - Blur подсветкой
   - Hover анимациями
   - Плавающими элементами
   
   Используйте структуру:
   <div class="animated-cards">
     <div class="card-box">
       <span></span>
       <div class="card-content">
         <h2>Title</h2>
         <p>Description</p>
         <a href="#">Button</a>
       </div>
     </div>
   </div>
*/

/* ========================================
   КОНТЕЙНЕР КАРТОЧЕК
   ======================================== */

.animated-cards {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 40px 0;
    gap: 30px;
}

/* ========================================
   БАЗОВАЯ КАРТОЧКА
   ======================================== */

.card-box {
    position: relative;
    width: 320px;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.5s;
}

/* 3D Фон карточки (передний слой) */
.card-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50px;
    width: 50%;
    height: 100%;
    background: #fff;
    border-radius: 12px;
    transform: skewX(15deg);
    transition: 0.5s;
    z-index: 0;
}

/* Blur подсветка */
.card-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50px;
    width: 50%;
    height: 100%;
    background: #fff;
    border-radius: 12px;
    transform: skewX(15deg);
    transition: 0.5s;
    filter: blur(30px);
    opacity: 0.8;
    z-index: -1;
}

/* Hover эффект - выпрямление и расширение */
.card-box:hover::before,
.card-box:hover::after {
    transform: skewX(0deg);
    left: 20px;
    width: calc(100% - 40px);
}

/* ========================================
   ЦВЕТОВЫЕ СХЕМЫ КАРТОЧЕК
   ======================================== */

/* Градиент 1: Красный-Розовый (Winstreak) */
.card-box.card-red::before,
.card-box.card-red::after {
    background: linear-gradient(315deg, #dc2626, #ef4444);
}

/* Градиент 2: Оранжевый-Красный */
.card-box.card-orange::before,
.card-box.card-orange::after {
    background: linear-gradient(315deg, #f97316, #dc2626);
}

/* Градиент 3: Красный-Желтый */
.card-box.card-yellow::before,
.card-box.card-yellow::after {
    background: linear-gradient(315deg, #fbbf24, #f97316);
}

/* Градиент 4: Синий-Розовый */
.card-box.card-blue::before,
.card-box.card-blue::after {
    background: linear-gradient(315deg, #3b82f6, #ec4899);
}

/* Градиент 5: Зеленый-Голубой */
.card-box.card-green::before,
.card-box.card-green::after {
    background: linear-gradient(315deg, #10b981, #06b6d4);
}

/* Градиент 6: Фиолетовый-Розовый */
.card-box.card-purple::before,
.card-box.card-purple::after {
    background: linear-gradient(315deg, #8b5cf6, #ec4899);
}

/* ========================================
   ПЛАВАЮЩИЕ ДЕКОРАТИВНЫЕ ЭЛЕМЕНТЫ
   ======================================== */

.card-box span {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    pointer-events: none;
}

/* Верхний плавающий элемент */
.card-box span::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: 0.3s;
    animation: card-float 3s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.card-box:hover span::before {
    top: -50px;
    left: 50px;
    width: 100px;
    height: 100px;
    opacity: 1;
}

/* Нижний плавающий элемент */
.card-box span::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: 0.5s;
    animation: card-float 3s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation-delay: -1.5s;
}

.card-box:hover span::after {
    bottom: -50px;
    right: 50px;
    width: 100px;
    height: 100px;
    opacity: 1;
}

/* Анимация плавания */
@keyframes card-float {
    0%, 100% {
        transform: translateY(10px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ========================================
   КОНТЕНТ КАРТОЧКИ
   ======================================== */

.card-content {
    position: relative;
    left: 0;
    padding: 30px 40px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    transition: 0.5s;
    color: #fff;
}

.card-box:hover .card-content {
    left: -25px;
    padding: 60px 40px;
}

/* Заголовок карточки */
.card-content h2 {
    font-size: 2em;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.card-content h3 {
    font-size: 1.5em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

/* Описание */
.card-content p {
    font-size: 1em;
    margin-bottom: 10px;
    line-height: 1.6em;
    color: rgba(255, 255, 255, 0.8);
}

/* Кнопка/ссылка */
.card-content a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    color: #000;
    background: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-content a:hover {
    background: linear-gradient(135deg, #fbbf24, #f97316);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
}

/* Иконка в кнопке */
.card-content a svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

@media (max-width: 768px) {
    .card-box {
        width: 280px;
        height: 380px;
        margin: 20px 15px;
    }

    .card-content {
        padding: 25px 30px;
    }

    .card-box:hover .card-content {
        left: -15px;
        padding: 50px 30px;
    }

    .card-content h2 {
        font-size: 1.6em;
    }

    .card-content h3 {
        font-size: 1.3em;
    }

    .card-content p {
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .card-box {
        width: 100%;
        max-width: 300px;
        height: 360px;
    }

    .card-box::before,
    .card-box::after {
        left: 30px;
    }

    .card-box:hover::before,
    .card-box:hover::after {
        left: 15px;
        width: calc(100% - 30px);
    }

    .card-content {
        padding: 20px 25px;
    }

    .card-box:hover .card-content {
        left: -10px;
        padding: 40px 25px;
    }
}

/* ========================================
   ВАРИАНТЫ РАЗМЕРОВ
   ======================================== */

/* Маленькая карточка */
.card-box.card-small {
    width: 280px;
    height: 350px;
}

/* Большая карточка */
.card-box.card-large {
    width: 380px;
    height: 480px;
}

/* Широкая карточка */
.card-box.card-wide {
    width: 400px;
    height: 320px;
}

/* ========================================
   ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ
   ======================================== */

/* Свечение при hover */
.card-box.card-glow:hover::after {
    filter: blur(50px);
    opacity: 1;
}

/* Пульсация */
.card-box.card-pulse::after {
    animation: card-pulse 2s ease-in-out infinite;
}

@keyframes card-pulse {
    0%, 100% {
        opacity: 0.6;
        transform: skewX(15deg) scale(1);
    }
    50% {
        opacity: 0.9;
        transform: skewX(15deg) scale(1.05);
    }
}

/* Вращение при hover */
.card-box.card-rotate:hover {
    transform: rotateY(5deg) scale(1.02);
}

/* ========================================
   ИНТЕГРАЦИЯ С СУЩЕСТВУЮЩИМ ДИЗАЙНОМ
   ======================================== */

/* Адаптация для темного фона Winstreak */
body[class*="gradient-"] .card-content {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
}

/* Совместимость с noise texture */
body .card-box {
    z-index: 3;
}

/* Performance optimization */
@media (prefers-reduced-motion: reduce) {
    .card-box,
    .card-box::before,
    .card-box::after,
    .card-content,
    .card-box span::before,
    .card-box span::after {
        animation: none !important;
        transition: none !important;
    }
}
