:root {
    --ai-primary: #5e5ce6;
    --ai-primary-rgb: 94, 92, 230;
    --ai-secondary: #ff375f;
    --ai-secondary-rgb: 255, 55, 95;
    --ai-black: #0c0c0c;
    --ai-gray-dark: #1a1a1a;
    --ai-gray: #333333;
    --ai-gray-light: #555555;
    --ai-white: #ffffff;
    --ai-border-radius: 18px;
    --ai-shadow-small: 0 5px 15px rgba(0, 0, 0, 0.1);
    --ai-shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.2);
    --ai-shadow-large: 0 15px 60px rgba(0, 0, 0, 0.3);
    --ai-animation-slow: 0.7s cubic-bezier(0.33, 1, 0.68, 1);
    --ai-animation-medium: 0.4s cubic-bezier(0.33, 1, 0.68, 1);
    --ai-animation-fast: 0.2s cubic-bezier(0.33, 1, 0.68, 1);
    --ai-animation-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    --ai-spacing-xs: 0.25rem;
    --ai-spacing-sm: 0.5rem;
    --ai-spacing-md: 1rem;
    --ai-spacing-lg: 1.5rem;
    --ai-spacing-xl: 2rem;
    --ai-font-size-xs: 0.75rem;
    --ai-font-size-sm: 0.875rem;
    --ai-font-size-md: 1rem;
    --ai-font-size-lg: 1.25rem;
    --ai-font-size-xl: 1.5rem;
    --ai-font-size-2xl: 2rem;
    --ai-card-ratio: 1 / 0.5;
}

@keyframes ai-fade-in {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes ai-float-up {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes ai-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes ai-rotate-gradient {
    0% { --gradient-angle: 0deg; }
    100% { --gradient-angle: 360deg; }
}

@keyframes ai-pulse-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

@keyframes ai-float-blob {
    0%, 100% { transform: translate(0, 0) rotate(0deg); filter: blur(70px); }
    33% { transform: translate(50px, -30px) rotate(10deg); filter: blur(60px); }
    66% { transform: translate(-40px, 40px) rotate(-10deg); filter: blur(80px); }
}

@keyframes ai-shimmer {
    0% { transform: translateX(-150%) rotate(30deg); }
    100% { transform: translateX(300%) rotate(30deg); }
}

@keyframes ai-title-glow {
    0%, 100% { text-shadow: 0 0 15px rgba(var(--ai-primary-rgb), 0.1); }
    50% { text-shadow: 0 0 30px rgba(var(--ai-primary-rgb), 0.3), 0 0 50px rgba(var(--ai-primary-rgb), 0.2); }
}

@keyframes ai-border-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 1px rgba(var(--theme-rgb, var(--ai-primary-rgb)), 0.1),
                  inset 0 0 0 1px rgba(var(--theme-rgb, var(--ai-primary-rgb)), 0.1);
    }
    50% { 
        box-shadow: 0 0 0 2px rgba(var(--theme-rgb, var(--ai-primary-rgb)), 0.2),
                  inset 0 0 0 1px rgba(var(--theme-rgb, var(--ai-primary-rgb)), 0.2);
    }
}

@keyframes ai-arrow-bounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

@keyframes ai-particles-move {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

@keyframes ai-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ai-shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-5px) rotate(-5deg); }
    50% { transform: translateX(5px) rotate(5deg); }
    75% { transform: translateX(-5px) rotate(-5deg); }
}

.ai-module {
    position: relative;
    margin: 0;
    padding: 40px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ai-white);
    overflow: visible;
}

.ai-header {
    position: relative;
    margin: 0 0 30px;
    width: 100%;
    overflow: visible;
}

.ai-title-container {
    text-align: center;
    margin: 0 auto;
    padding: 0 20px;
    max-width: 100%;
    overflow: visible;
}

.ai-title {
    position: relative;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--ai-primary);
    text-transform: uppercase;
    margin: 0 0 15px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    display: block;
    animation: ai-title-glow 4s ease-in-out infinite;
    text-align: center;
    width: 100%;
    transform: none !important;
}

.ai-title-highlight {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    height: 6px;
    width: 80px;
    background: linear-gradient(90deg, var(--ai-primary), var(--ai-secondary));
    border-radius: 3px;
    opacity: 0.8;
    box-shadow: 0 0 20px rgba(var(--ai-primary-rgb), 0.6);
}

.ai-tagline {
    margin: 20px auto 0;
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    text-align: center;
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--ai-spacing-xl);
    padding: 0 var(--ai-spacing-md);
    max-width: 1200px;
    margin: 0 auto;
}

.ai-card {
    position: relative;
    aspect-ratio: var(--ai-card-ratio);
    opacity: 0;
    transform: translateY(30px);
    animation: ai-fade-in var(--ai-animation-slow) forwards;
    animation-delay: calc(var(--data-index, 1) * 0.15s);
}

.ai-card:nth-child(1) {
    animation-delay: 0.15s;
}

.ai-card:nth-child(2) {
    animation-delay: 0.3s;
}

.ai-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--ai-border-radius);
    overflow: hidden;
    background-color: var(--ai-gray-dark);
    box-shadow: var(--ai-shadow-medium);
    transition: all var(--ai-animation-medium);
    transform-style: preserve-3d;
    perspective: 1000px;
    animation: ai-border-pulse 3s ease-in-out infinite;
}

.ai-card:hover .ai-card-inner {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--ai-shadow-large),
                0 0 30px rgba(var(--theme-rgb, var(--ai-primary-rgb)), 0.2);
}

.ai-card-link {
    position: absolute;
    inset: 0;
    display: block;
    text-decoration: none;
    color: var(--ai-white);
    overflow: hidden;
    z-index: 1;
}

.ai-image-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.ai-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform var(--ai-animation-slow);
    transform: scale(1.03);
    filter: saturate(1.1) contrast(1.1);
    will-change: transform;
}

.ai-image-search {
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="1600" height="900" viewBox="0 0 1600 900"%3E%3Crect width="1600" height="900" fill="%232e2e2e"/%3E%3Cg fill-opacity="0.15"%3E%3Cpath fill="%235e5ce6" d="M486 705.8c-109.3-21.8-223.4-32.2-335.3-19.4C99.5 692.1 49 703 0 719.8V800h843.8c-115.9-33.2-230.8-68.1-347.6-92.2C492.8 707.1 489.4 706.5 486 705.8z"/%3E%3Cpath fill="%235655d6" d="M1600 0H0v719.8c49-16.8 99.5-27.8 150.7-33.5c111.9-12.7 226-2.4 335.3 19.4c3.4 0.7 6.8 1.4 10.2 2c116.8 24 231.7 59 347.6 92.2H1600V0z"/%3E%3Cpath fill="%234f4fc7" d="M478.4 581c3.2 0.8 6.4 1.7 9.5 2.5c196.2 52.5 388.7 133.5 593.5 176.6c174.2 36.6 349.5 29.2 518.6-10.2V0H0v574.9c52.3-17.6 106.5-27.7 161.1-30.9C268.4 537.4 375.7 554.2 478.4 581z"/%3E%3Cpath fill="%234748b7" d="M0 0v429.4c55.6-18.4 113.5-27.3 171.4-27.7c102.8-0.8 203.2 22.7 299.3 54.5c3 1 5.9 2 8.9 3c183.6 62 365.7 146.1 562.4 192.1c186.7 43.7 376.3 34.4 557.9-12.6V0H0z"/%3E%3Cpath fill="%233f42a8" d="M181.8 259.4c98.2 6 191.9 35.2 281.3 72.1c2.8 1.1 5.5 2.3 8.3 3.4c171 71.6 342.7 158.5 531.3 207.7c198.8 51.8 403.4 40.8 597.3-14.8V0H0v283.2C59 263.6 120.6 255.7 181.8 259.4z"/%3E%3Cpath fill="%23373b99" d="M1600 0H0v136.3c62.3-20.9 127.7-27.5 192.2-19.2c93.6 12.1 180.5 47.7 263.3 89.6c2.6 1.3 5.1 2.6 7.7 3.9c158.4 81.1 319.7 170.9 500.3 223.2c210.5 61 430.8 49 636.6-16.6V0z"/%3E%3Cpath fill="%23303589" d="M454.9 86.3C600.7 177 751.6 269.3 924.1 325c208.6 67.4 431.3 60.8 637.9-5.3c12.8-4.1 25.4-8.4 38.1-12.9V0H288.1c56 21.3 108.7 50.6 159.7 82C450.2 83.4 452.5 84.9 454.9 86.3z"/%3E%3Cpath fill="%23282e7a" d="M1600 0H498c118.1 85.8 243.5 164.5 386.8 216.2c191.8 69.2 400 74.7 595 21.1c40.8-11.2 81.1-25.2 120.3-41.7V0z"/%3E%3Cpath fill="%23202770" d="M1397.5 154.8c47.2-10.6 93.6-25.3 138.6-43.8c21.7-8.9 43-18.8 63.9-29.5V0H643.4c62.9 41.7 129.7 78.2 202.1 107.4C1020.4 178.1 1214.2 196.1 1397.5 154.8z"/%3E%3Cpath fill="%23191f61" d="M1315.3 72.4c75.3-12.6 148.9-37.1 216.8-72.4h-723C966.8 71 1144.7 101 1315.3 72.4z"/%3E%3C/g%3E%3C/svg%3E');
}

.ai-image-wheel {
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="1600" height="900" viewBox="0 0 1600 900"%3E%3Crect width="1600" height="900" fill="%232e2e2e"/%3E%3Cg fill-opacity="0.15"%3E%3Cpath fill="%23ff375f" d="M486 705.8c-109.3-21.8-223.4-32.2-335.3-19.4C99.5 692.1 49 703 0 719.8V800h843.8c-115.9-33.2-230.8-68.1-347.6-92.2C492.8 707.1 489.4 706.5 486 705.8z"/%3E%3Cpath fill="%23f23659" d="M1600 0H0v719.8c49-16.8 99.5-27.8 150.7-33.5c111.9-12.7 226-2.4 335.3 19.4c3.4 0.7 6.8 1.4 10.2 2c116.8 24 231.7 59 347.6 92.2H1600V0z"/%3E%3Cpath fill="%23e63552" d="M478.4 581c3.2 0.8 6.4 1.7 9.5 2.5c196.2 52.5 388.7 133.5 593.5 176.6c174.2 36.6 349.5 29.2 518.6-10.2V0H0v574.9c52.3-17.6 106.5-27.7 161.1-30.9C268.4 537.4 375.7 554.2 478.4 581z"/%3E%3Cpath fill="%23d9334c" d="M0 0v429.4c55.6-18.4 113.5-27.3 171.4-27.7c102.8-0.8 203.2 22.7 299.3 54.5c3 1 5.9 2 8.9 3c183.6 62 365.7 146.1 562.4 192.1c186.7 43.7 376.3 34.4 557.9-12.6V0H0z"/%3E%3Cpath fill="%23cc3245" d="M181.8 259.4c98.2 6 191.9 35.2 281.3 72.1c2.8 1.1 5.5 2.3 8.3 3.4c171 71.6 342.7 158.5 531.3 207.7c198.8 51.8 403.4 40.8 597.3-14.8V0H0v283.2C59 263.6 120.6 255.7 181.8 259.4z"/%3E%3Cpath fill="%23bf303f" d="M1600 0H0v136.3c62.3-20.9 127.7-27.5 192.2-19.2c93.6 12.1 180.5 47.7 263.3 89.6c2.6 1.3 5.1 2.6 7.7 3.9c158.4 81.1 319.7 170.9 500.3 223.2c210.5 61 430.8 49 636.6-16.6V0z"/%3E%3Cpath fill="%23b22e38" d="M454.9 86.3C600.7 177 751.6 269.3 924.1 325c208.6 67.4 431.3 60.8 637.9-5.3c12.8-4.1 25.4-8.4 38.1-12.9V0H288.1c56 21.3 108.7 50.6 159.7 82C450.2 83.4 452.5 84.9 454.9 86.3z"/%3E%3Cpath fill="%23a52c32" d="M1600 0H498c118.1 85.8 243.5 164.5 386.8 216.2c191.8 69.2 400 74.7 595 21.1c40.8-11.2 81.1-25.2 120.3-41.7V0z"/%3E%3Cpath fill="%23982a2b" d="M1397.5 154.8c47.2-10.6 93.6-25.3 138.6-43.8c21.7-8.9 43-18.8 63.9-29.5V0H643.4c62.9 41.7 129.7 78.2 202.1 107.4C1020.4 178.1 1214.2 196.1 1397.5 154.8z"/%3E%3Cpath fill="%238a2825" d="M1315.3 72.4c75.3-12.6 148.9-37.1 216.8-72.4h-723C966.8 71 1144.7 101 1315.3 72.4z"/%3E%3C/g%3E%3C/svg%3E');
}

.ai-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10, 10, 10, 0.95) 0%,
        rgba(10, 10, 10, 0.7) 50%,
        rgba(10, 10, 10, 0.4) 100%
    );
    transition: opacity var(--ai-animation-medium);
    mix-blend-mode: multiply;
}

.ai-card:hover .ai-image {
    transform: scale(1.08);
}

.ai-card:hover .ai-image-overlay {
    background: linear-gradient(
        to top,
        rgba(10, 10, 10, 0.9) 0%,
        rgba(var(--theme-rgb, var(--ai-primary-rgb)), 0.2) 100%
    );
}

.ai-icon-wrapper {
    position: absolute;
    top: var(--ai-spacing-lg);
    left: var(--ai-spacing-lg);
    z-index: 3;
    transition: transform var(--ai-animation-medium);
}

.ai-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--ai-font-size-lg);
    background: rgba(20, 20, 20, 0.8);
    color: var(--theme, var(--ai-primary));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--ai-animation-bounce);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.ai-icon-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at center, var(--theme, var(--ai-primary)) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--ai-animation-medium);
    filter: blur(8px);
}

.ai-card:hover .ai-icon-wrapper {
    transform: translateY(-5px);
}

.ai-card:hover .ai-icon {
    background: var(--theme, var(--ai-primary));
    color: white;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2),
                0 0 20px rgba(var(--theme-rgb, var(--ai-primary-rgb)), 0.4);
}

.ai-card:hover .ai-icon-glow {
    opacity: 0.7;
    animation: ai-pulse-glow 3s ease-in-out infinite;
}

.ai-icon-search i {
    transition: transform var(--ai-animation-medium);
}

.ai-card:hover .ai-icon-search i {
    transform: scale(1.1);
}

.ai-icon-wheel i {
    transition: transform var(--ai-animation-medium);
}

.ai-card:hover .ai-icon-wheel i {
    animation: ai-rotate 3s linear infinite;
}

.ai-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--ai-spacing-xl) var(--ai-spacing-lg);
    z-index: 2;
    transition: transform var(--ai-animation-medium);
}

.ai-card-title {
    font-size: var(--ai-font-size-xl);
    font-weight: 800;
    margin: 0 0 var(--ai-spacing-md);
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    transition: transform var(--ai-animation-bounce);
}

.ai-meta {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 40px;
    font-size: var(--ai-font-size-sm);
    transition: all var(--ai-animation-bounce);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-label {
    opacity: 0.9;
    font-weight: 500;
}

.ai-arrow {
    display: flex;
    align-items: center;
    margin-left: 8px;
    transform: translateX(0);
    transition: transform var(--ai-animation-medium);
}

.ai-arrow-icon {
    width: 16px;
    height: 16px;
}

.ai-card:hover .ai-content {
    transform: translateY(-8px);
}

.ai-card:hover .ai-card-title {
    transform: scale(1.05);
}

.ai-card:hover .ai-meta {
    background: var(--theme, var(--ai-primary));
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.ai-card:hover .ai-arrow {
    animation: ai-arrow-bounce 1s ease-in-out infinite;
}

.ai-card-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    border-radius: var(--ai-border-radius);
    overflow: hidden;
}

.ai-card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(var(--gradient-angle), transparent, rgba(var(--theme-rgb, var(--ai-primary-rgb)), 0.1), transparent);
    opacity: 0;
    transition: opacity var(--ai-animation-medium);
}

.ai-card-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-150%) rotate(30deg);
    pointer-events: none;
}

.ai-card-border {
    position: absolute;
    inset: 0;
    border-radius: var(--ai-border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color var(--ai-animation-medium);
}

.ai-card-noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    opacity: 0.03;
    mix-blend-mode: overlay;
}

.ai-card:hover .ai-card-gradient {
    opacity: 1;
    animation: ai-rotate-gradient 6s linear infinite;
}

.ai-card:hover .ai-card-shine {
    animation: ai-shimmer 1.2s var(--ai-animation-medium) forwards;
}

.ai-card:hover .ai-card-border {
    border-color: rgba(var(--theme-rgb, var(--ai-primary-rgb)), 0.3);
}

#spin-the-wheel-link.click-animation .ai-card-inner {
    animation: ai-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

#spin-the-wheel-link.click-animation .ai-icon {
    animation: ai-rotate 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both, ai-pulse 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@media (prefers-reduced-motion) {
    .ai-card,
    .ai-blob,
    .ai-title,
    .ai-card-shine,
    .ai-particles {
        animation: none !important;
    }
    
    .ai-card {
        opacity: 1;
        transform: none;
    }
    
    .ai-card:hover .ai-icon,
    .ai-card:hover .ai-meta,
    .ai-card:hover .ai-card-gradient,
    .ai-card:hover .ai-arrow {
        animation: none !important;
    }
}

@media (max-width: 1200px) {
    .ai-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 25px;
    }
    
    .ai-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 992px) {
    .ai-icon-wrapper {
        top: 20px;
        left: 20px;
    }
    
    .ai-icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
    
    .ai-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .ai-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ai-content {
        padding: 20px;
    }
    
    .ai-card-title {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .ai-meta {
        padding: 6px 12px;
    }
    
    .ai-title {
        font-size: 1.8rem;
    }
    
    .ai-tagline {
        font-size: 1.1rem;
    }
    
    .ai-header {
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .ai-icon-wrapper {
        top: 15px;
        left: 15px;
    }
    
    .ai-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .ai-content {
        padding: 15px;
    }
    
    .ai-card-title {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .ai-meta {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
    
    .ai-title {
        font-size: 1.6rem;
    }
    
    .ai-tagline {
        font-size: 1rem;
    }
    
    .ai-header {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .ai-title {
        font-size: 1.4rem;
    }
}