/* Flap Section */
.flap-section {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #0a0a1a 100%);
    position: relative;
    overflow: hidden;
}

.flap-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(64, 224, 208, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.flap-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.flap-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.flap-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(64, 224, 208, 0.12), rgba(138, 43, 226, 0.12));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.flap-card:hover::before {
    opacity: 1;
}

.flap-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(64, 224, 208, 0.4);
    box-shadow: 0 20px 40px rgba(64, 224, 208, 0.25);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    position: relative;
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #40e0d0, #20b2aa);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.flap-card:hover .card-title::after {
    width: 60px;
}

.card-desc {
    font-size: 1.1rem;
    color: #cccccc;
    line-height: 1.6;
    margin: 0;
}

.flap-cta {
    text-align: center;
    position: relative;
    z-index: 1;
}

.flap-cta .btn {
    font-size: 1.2rem;
    padding: 16px 32px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.flap-cta .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.flap-cta .btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Card Animation */
.flap-card {
    opacity: 0;
    transform: translateY(50px);
    animation: cardSlideIn 0.8s ease-out forwards;
}

.flap-card:nth-child(1) {
    animation-delay: 0.1s;
}

.flap-card:nth-child(2) {
    animation-delay: 0.3s;
}

.flap-card:nth-child(3) {
    animation-delay: 0.5s;
}

@keyframes cardSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Floating Animation for Cards */
.flap-card:nth-child(1) {
    animation: cardSlideIn 0.8s ease-out forwards, float1 4s ease-in-out forwards 1s;
}

.flap-card:nth-child(2) {
    animation: cardSlideIn 0.8s ease-out forwards, float2 4s ease-in-out forwards 1.5s;
}

.flap-card:nth-child(3) {
    animation: cardSlideIn 0.8s ease-out forwards, float3 4s ease-in-out forwards 2s;
}

@keyframes float1 {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-12px);
    }
}

@keyframes float3 {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .flap-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .flap-card {
        padding: 2rem;
    }

    .card-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .card-title {
        font-size: 1.3rem;
    }

    .card-desc {
        font-size: 1rem;
    }

    .flap-cta .btn {
        font-size: 1.1rem;
        padding: 14px 28px;
    }
}

@media (max-width: 480px) {
    .flap-card {
        padding: 1.5rem;
    }

    .card-icon {
        font-size: 2rem;
    }

    .card-title {
        font-size: 1.2rem;
    }

    .card-desc {
        font-size: 0.95rem;
    }

    .flap-cta .btn {
        font-size: 1rem;
        padding: 12px 24px;
        width: 100%;
        max-width: 280px;
    }
}

/* Special Effects */
.flap-card:nth-child(1):hover {
    box-shadow: 0 20px 40px rgba(64, 224, 208, 0.35);
}

.flap-card:nth-child(2):hover {
    box-shadow: 0 20px 40px rgba(138, 43, 226, 0.35);
}

.flap-card:nth-child(3):hover {
    box-shadow: 0 20px 40px rgba(75, 0, 130, 0.35);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .flap-card {
        animation: none;
    }
    
    .flap-card:hover {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .flap-card {
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .card-title {
        color: #ffffff;
    }
    
    .card-desc {
        color: #e0e0e0;
    }
}

/* XCAT Banner Styles */
.xcat-banner {
    max-width: 600px;
    width: 80%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: block;
    margin: 2rem auto;
    opacity: 1 !important;
    z-index: 10;
    position: relative;
}

.xcat-banner:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(64, 224, 208, 0.2);
}

@media (max-width: 768px) {
    .xcat-banner {
        max-width: 400px;
        width: 90%;
        border-radius: 10px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
        margin: 1.5rem auto;
    }
    
    .xcat-banner:hover {
        transform: scale(1.01);
    }
}

@media (max-width: 480px) {
    .xcat-banner {
        max-width: 300px;
        width: 95%;
        margin: 1rem auto;
    }
}