/* ==========================================
   Module Pages Specific Styles
   ========================================== */

/* Module specific overrides */
.module-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--accent-gradient);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    animation: fadeIn 0.8s ease-out;
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.7;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Container Override */
.container {
    max-width: 1100px;
    padding: 2.5rem 2rem 4rem;
}

/* Section Grid */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 2rem;
}

/* Section Card */
.section-card {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    animation: fadeInScale 0.6s ease-out both;
    will-change: transform, box-shadow;
}

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

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

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

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

.section-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);
}

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

.section-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow, 0 0 40px rgba(16, 185, 129, 0.15));
    border-color: var(--module-color);
}

.section-number {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-gradient, linear-gradient(135deg, var(--module-color), var(--module-color-dark)));
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.section-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

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

.section-meta svg {
    width: 16px;
    height: 16px;
}

.arrow-icon {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 24px;
    height: 24px;
    color: var(--module-color);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

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

/* Mind Map Section Overrides */
.mindmap-title {
    text-align: center;
    background: linear-gradient(135deg, var(--module-color), var(--module-color-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mindmap-description {
    text-align: center;
}

.mindmap-container {
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 0 30px rgba(var(--module-color-rgb, 16, 185, 129), 0.1);
}

.mindmap-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 50px rgba(var(--module-color-rgb, 16, 185, 129), 0.15);
}

.mindmap-zoom-hint {
    background: var(--module-color);
}

.mindmap-container:hover .mindmap-zoom-hint {
    background: var(--module-color-dark);
}

/* Modal Overrides */
.modal {
    background-color: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    max-height: 90vh;
    border-radius: 16px;
}

.modal-close:hover {
    color: var(--module-color);
}

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

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

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

    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);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sections-grid {
        gap: 1.5rem;
    }

    .section-card {
        padding: 1.5rem;
    }

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

/* Default color variables - can be overridden per module */
:root {
    --bg-primary: #0A0E27;
    --bg-secondary: #1A1F3A;
    --bg-card: #242B4A;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* 
   Background Animation 
   Optimized with will-change for GPU acceleration
*/
.background-animation::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: var(--module-color);
    filter: blur(100px);
    opacity: 0.2;
    top: -250px;
    right: -250px;
    animation: float 25s infinite ease-in-out;
    will-change: transform;
    /* Performance optimization */
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-100px, 100px) scale(1.1);
    }
}

/* Breadcrumb Navigation */
.breadcrumb {
    position: relative;
    z-index: 10;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--module-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--module-color-dark);
}

.breadcrumb-separator {
    opacity: 0.5;
}

/* Header */
header {
    position: relative;
    z-index: 10;
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.module-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--accent-gradient);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    animation: fadeIn 0.8s ease-out;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    animation: fadeInDown 0.8s ease-out;
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.7;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Container */
.container {
    position: relative;
    z-index: 5;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
}

/* Section Grid */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 2rem;
}

/* Section Card */
/* 
   Section Card 
   Interactive card with hover effects
   Optimized for smooth transitions
*/
.section-card {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    animation: fadeInScale 0.6s ease-out both;
    will-change: transform, box-shadow;
    /* Optimize hover performance */
}

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

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

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

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

.section-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);
}

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

.section-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow);
    border-color: var(--module-color);
}

.section-number {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-gradient);
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.section-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

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

.section-meta svg {
    width: 16px;
    height: 16px;
}

.arrow-icon {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 24px;
    height: 24px;
    color: var(--module-color);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

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

/* Mind Map Section */
.mindmap-section {
    margin-bottom: 4rem;
}

.mindmap-title {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--module-color), var(--module-color-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 0.75rem;
}

.mindmap-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.mindmap-container {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 30px rgba(var(--module-color-rgb), 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mindmap-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 50px rgba(var(--module-color-rgb), 0.15);
}

.mindmap-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
}

.mindmap-zoom-hint {
    position: absolute;
    bottom: 2.5rem;
    right: 2.5rem;
    background: var(--module-color);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    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: var(--module-color-dark);
    transform: scale(1.05);
}

/* Modal for Zoomed Image */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding: 2rem;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 95%;
    max-height: 90vh;
    border-radius: 16px;
    animation: zoom 0.3s ease;
}

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

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

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

.modal-close:hover {
    color: var(--module-color);
    transform: rotate(90deg);
}

/* Footer */
footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2.5rem 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer a {
    color: var(--module-color);
    text-decoration: none;
}

footer a:hover {
    color: var(--module-color-dark);
}

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

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

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

    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);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .breadcrumb {
        padding: 1rem 1.5rem;
    }

    header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .container {
        padding: 2rem 1.5rem 3rem;
    }

    .sections-grid {
        gap: 1.5rem;
    }

    .section-card {
        padding: 1.5rem;
    }

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