/* ==========================================
   Index Page Specific Styles
   ========================================== */

/* Custom CSS Variables for Index */
:root {
    --accent-primary: #6366F1;
    --accent-secondary: #8B5CF6;
    --accent-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    --border-color: rgba(99, 102, 241, 0.2);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --module-1: #10B981;
    --module-2: #F59E0B;
    --module-3: #EF4444;
    --module-4: #3B82F6;
}

/* Enhanced background for index */
/* 
   Enhanced background for index 
   Uses pseudo-element for performance
   Optimized with will-change
*/
.background-animation::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: var(--accent-secondary);
    bottom: -250px;
    right: -250px;
    filter: blur(100px);
    opacity: 0.25;
    animation: float 25s infinite ease-in-out;
    animation-delay: 7s;
    will-change: transform;
    /* GPU acceleration */
}

/* Header animations */
header {
    padding: 4rem 2rem 2rem;
}

h1 {
    animation: fadeInDown 0.8s ease-out;
}

.subtitle {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.description {
    animation: fadeIn 1s ease-out 0.4s both;
}

/* Module card enhancements */
/* 
   Module card enhancements 
   Main navigation cards
   Optimized for hover interactions
*/
.module-card {
    animation: fadeInScale 0.6s ease-out both;
    will-change: transform, box-shadow;
    /* Optimize hover performance */
}

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

.module-card:nth-child(2) {
    animation-delay: 0.2s;
}

.module-card:nth-child(3) {
    animation-delay: 0.3s;
}

.module-card:nth-child(4) {
    animation-delay: 0.4s;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--module-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.module-card:hover::before {
    transform: scaleX(1);
}

.module-number {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.module-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.module-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.module-meta-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.arrow-icon {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    opacity: 0;
    transform: translateX(-10px);
}

.module-card:hover .arrow-icon {
    opacity: 1;
    transform: translateX(0);
}

/* Mindmap specific for index */
.mindmap-section {
    margin-bottom: 4rem;
}

.mindmap-title {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mindmap-container {
    box-shadow: var(--shadow-glow);
}

.mindmap-container:hover {
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.2);
}

.mindmap-zoom-hint {
    position: absolute;
    bottom: 3rem;
    right: 3rem;
    background: rgba(99, 102, 241, 0.9);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.mindmap-container:hover .mindmap-zoom-hint {
    background: rgba(139, 92, 246, 0.9);
    transform: scale(1.05);
}

/* Modal specific */
.modal {
    backdrop-filter: blur(10px);
}

.modal-content {
    animation: zoom 0.3s ease;
    will-change: transform, opacity;
}

@keyframes zoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    font-size: 3rem;
    font-weight: 300;
    z-index: 1001;
    cursor: pointer;
    color: white;
    background: none;
    border: none;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #6366F1;
    transform: rotate(90deg);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Module specific colors */
.module-card[data-module="1"] {
    --module-color: var(--module-1);
    --module-color-dark: #059669;
}

.module-card[data-module="2"] {
    --module-color: var(--module-2);
    --module-color-dark: #D97706;
}

.module-card[data-module="3"] {
    --module-color: var(--module-3);
    --module-color-dark: #DC2626;
}

.module-card[data-module="4"] {
    --module-color: var(--module-4);
    --module-color-dark: #2563EB;
}

/* Responsive Design */
@media (max-width: 768px) {
    .arrow-icon {
        opacity: 1;
        transform: translateX(0);
    }

    .mindmap-zoom-hint {
        bottom: 1.5rem;
        right: 1.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .modal-close {
        top: 1rem;
        right: 1.5rem;
        font-size: 2.5rem;
    }
}