:root {
    /* Google-inspired Light Theme Color Palette */
    --bg-dark: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-elevated: #f8f9fa;
    --primary: #1a73e8;
    --primary-glow: rgba(26, 115, 232, 0.15);
    --secondary: #9c27b0;
    --text-main: #202124;
    --text-muted: #5f6368;
    --glass-border: rgba(0, 0, 0, 0.08);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: #f8f9fa;
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animated Background Orbs (Soft Pastels for Light Mode) */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    animation: float 25s infinite ease-in-out alternate;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: rgba(26, 115, 232, 0.07);
    top: -150px;
    left: -100px;
}

.orb-2 {
    width: 700px;
    height: 700px;
    background: rgba(156, 39, 176, 0.05);
    bottom: 10%;
    right: -200px;
    animation-delay: -5s;
}

.orb-3 {
    width: 500px;
    height: 500px;
    background: rgba(52, 168, 83, 0.04);
    top: 30%;
    left: 10%;
    animation-delay: -10s;
}

@keyframes float {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(40px, 40px) scale(1.05); }
    100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* Navigation */
/* City Map Canvas Background */
#city-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.22;
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 1rem 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    padding-top: 80px;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 800px;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: rgba(26, 115, 232, 0.08);
    border: 1px solid rgba(26, 115, 232, 0.2);
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    color: var(--primary);
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 5.5rem);
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
    color: var(--text-main);
}

.hero p {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.85rem 2.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-family: var(--font-body);
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: 1px solid var(--primary);
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.3);
}

.btn-primary:hover {
    background: #1557b0;
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
    transform: translateY(-2px);
}

.btn-outline {
    background: #ffffff;
    color: var(--primary);
    border: 1px solid var(--glass-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Common Section Styles */
section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.section-header {
    margin-bottom: 4rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.section-header .line {
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.about-card {
    padding: 2.5rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.about-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(26, 115, 232, 0.1);
    border-color: var(--primary);
}

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

.about-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.about-card p {
    color: var(--text-muted);
}

/* Assignments Section */
.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
}

.assignments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.assignment-card {
    border-radius: 24px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.assignment-card:hover {
    transform: translateY(-12px);
    border-color: var(--primary);
    box-shadow: 0 20px 50px rgba(26, 115, 232, 0.12);
}

.card-image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
}

.bg-gradient-1 { background: linear-gradient(135deg, #1a73e8, #00b0ff); }
.bg-gradient-2 { background: linear-gradient(135deg, #9c27b0, #e91e63); }
.bg-gradient-3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.bg-gradient-4 { background: linear-gradient(135deg, #34a853, #00bcd4); }

.card-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(26, 115, 232, 0.08);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    align-self: flex-start;
    letter-spacing: 0.5px;
}

.card-content h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: var(--text-main);
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.read-more {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.assignment-card:hover .read-more {
    color: #1557b0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(32, 33, 36, 0.5);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 700px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid var(--glass-border);
    box-shadow: 0 30px 80px rgba(0,0,0,0.15);
    position: relative;
    transform: translateY(50px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: var(--text-muted);
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10;
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-header {
    padding: 3rem 3rem 2rem;
    background: #f8f9fa;
    border-bottom: 1px solid var(--glass-border);
}

.modal-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--primary);
    color: #ffffff;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    line-height: 1.2;
    color: var(--text-main);
}

.modal-body {
    padding: 3rem;
}

.modal-section {
    margin-bottom: 2.5rem;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.modal-section p {
    color: var(--text-muted);
    line-height: 1.8;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--glass-border);
    border-bottom: none;
    border-left: none;
    border-right: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: #ffffff;
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-actions { flex-direction: column; align-items: center; }
    .modal-content { margin: 10% auto; width: 95%; }
    .modal-header { padding: 2rem 2rem 1.5rem; }
    .modal-body { padding: 2rem; }
}

/* Book Mode Styles */
.book-layout {
    display: flex;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    padding-top: 120px;
}

.book-toc {
    width: 280px;
    position: sticky;
    top: 120px;
    height: fit-content;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.book-toc h4 {
    font-family: var(--font-heading);
    color: var(--primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.book-toc ul {
    list-style: none;
}

.book-toc li {
    margin-bottom: 12px;
}

.book-toc a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: block;
    line-height: 1.4;
}

.book-toc a:hover, .book-toc a.active {
    color: var(--primary);
    transform: translateX(5px);
}

.book-content {
    flex: 1;
    background: #fdfdfd;
    color: #1a1a1a;
    padding: 80px 100px;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.08);
    font-family: 'Libre Baskerville', 'Playfair Display', serif;
    line-height: 1.8;
    position: relative;
}

.book-content::before {
    content: '';
    position: absolute;
    top: 0; left: 20px; bottom: 0; width: 1px;
    background: rgba(0,0,0,0.04);
}

.book-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 2rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 1rem;
}

.book-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    margin: 3rem 0 1.5rem;
    color: #333;
}

.book-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    margin: 2rem 0 1rem;
    color: #444;
}

.book-content p {
    margin-bottom: 1.5rem;
    font-size: 1.15rem;
    text-align: justify;
}

.book-content .placeholder-fig {
    background: #f1f1f1;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    margin: 3rem 0;
    position: relative;
}

.placeholder-fig::after {
    content: 'Figure Placeholder';
    display: block;
    color: #888;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

.book-content figcaption {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: #666;
    text-align: center;
    font-style: italic;
    margin-top: 1.5rem;
    margin-bottom: 4rem;
}

.book-content .table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
}

.book-content table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 1rem;
}

.book-content th, .book-content td {
    border: 1px solid #eee;
    padding: 12px;
    text-align: left;
}

.book-content th {
    background: #f9f9f9;
}

@media (max-width: 1024px) {
    .book-layout {
        flex-direction: column;
        padding: 100px 20px;
    }
    .book-toc {
        width: 100%;
        position: relative;
        top: 0;
        margin-bottom: 40px;
    }
    .book-content {
        padding: 40px 30px;
    }
}

.book-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 3rem auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* ─── Lab 2: Hadoop Cluster Animation (Light Mode) ─── */

.hadoop-section {
    position: relative;
    padding: 60px 40px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    margin: 40px 0;
    overflow: hidden;
}

.cluster-container {
    height: 450px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cluster-nodes {
    position: relative;
    width: 100%;
    height: 100%;
}

.node {
    position: absolute;
    width: 100px;
    height: 100px;
    background: #ffffff;
    border: 1.5px solid var(--glass-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.node.master {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 8px 30px rgba(26, 115, 232, 0.15);
}

.node.worker {
    width: 90px;
    height: 90px;
}

/* Worker Positions */
.worker-1 { top: 15%; left: 15%; }
.worker-2 { top: 15%; right: 15%; }
.worker-3 { bottom: 15%; left: 15%; }
.worker-4 { bottom: 15%; right: 15%; }

.node span {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-align: center;
    line-height: 1.3;
    padding: 0 8px;
}

.node .status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34a853;
    margin-top: 8px;
    box-shadow: 0 0 8px rgba(52, 168, 83, 0.6);
}

.node.active {
    background: rgba(26, 115, 232, 0.06);
    border-color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(26, 115, 232, 0.2);
}

.node.master.active { transform: translate(-50%, -50%) scale(1.05); }

.node.mapping {
    background: rgba(156, 39, 176, 0.08);
    border-color: var(--secondary);
    box-shadow: 0 8px 30px rgba(156, 39, 176, 0.2);
}

.node.reducing {
    background: rgba(233, 30, 99, 0.06);
    border-color: #e91e63;
    box-shadow: 0 8px 30px rgba(233, 30, 99, 0.15);
}

/* Data Particles */
.particle {
    position: absolute;
    width: 7px;
    height: 7px;
    background: var(--primary);
    border-radius: 50%;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    box-shadow: 0 0 8px rgba(26, 115, 232, 0.5);
}

.particle.visible { opacity: 1; }

.connection-grid {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0.04;
    background-image: radial-gradient(#202124 1px, transparent 1px);
    background-size: 30px 30px;
}

.sim-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
}

.phase-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 18px;
    background: rgba(26, 115, 232, 0.07);
    border-radius: 50px;
    border: 1px solid rgba(26, 115, 232, 0.2);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
}

.sim-log {
    margin-top: 24px;
    padding: 18px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    font-family: var(--font-mono);
    font-size: 0.83rem;
    color: var(--text-muted);
    max-height: 180px;
    overflow-y: auto;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.02);
}

.sim-log p {
    margin-bottom: 7px;
    border-left: 3px solid #dadce0;
    padding-left: 12px;
}

.sim-log p.success {
    border-color: #34a853;
    color: #1e7e34;
}

.sim-log p.warning {
    border-color: #fbbc05;
    color: #9a6700;
}
