/* Import Blueprint Theme Fonts */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

/* Blueprint Theme Color Variables */
:root {
    /* Primary Blueprint Colors - Light Mode */
    --blueprint-bg-primary: #F0F4F8;
    --blueprint-bg-secondary: #FFFFFF;
    --blueprint-bg-accent: #E0E7EF;
    --blueprint-text-primary: #334155;
    --blueprint-text-secondary: #64748B;
    --blueprint-text-muted: #94A3B8;

    /* Accent Colors - Sky Blue & Purple */
    --blueprint-sky: #0EA5E9;
    --blueprint-sky-light: #38BDF8;
    --blueprint-sky-dark: #0284C7;
    --blueprint-purple: #8B5CF6;
    --blueprint-purple-light: #A78BFA;
    --blueprint-purple-dark: #7C3AED;

    /* Border & Grid Colors */
    --blueprint-border: #CBD5E1;
    --blueprint-grid: rgba(203, 213, 225, 0.3);

    /* Semantic Colors */
    --success-bg: #ECFDF5;
    --success-border: #10B981;
    --success-text: #047857;
    --warning-bg: #FEF3C7;
    --warning-border: #F59E0B;
    --warning-text: #D97706;
    --error-bg: #FEE2E2;
    --error-border: #EF4444;
    --error-text: #DC2626;

    /* Shadow Colors */
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.15);

    /* Spacing Scale - Based on 4px grid system */
    --space-1: 4px;      /* 0.25rem */
    --space-2: 8px;      /* 0.5rem */
    --space-3: 12px;     /* 0.75rem */
    --space-4: 16px;     /* 1rem */
    --space-5: 20px;     /* 1.25rem */
    --space-6: 24px;     /* 1.5rem */
    --space-8: 32px;     /* 2rem */
    --space-10: 40px;    /* 2.5rem */
    --space-12: 48px;    /* 3rem */
    --space-16: 64px;    /* 4rem */
    --space-20: 80px;    /* 5rem */
    --space-24: 96px;    /* 6rem */

    /* Typography Scale */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-size-4xl: 2.25rem;   /* 36px */
    --font-size-5xl: 3rem;      /* 48px */

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.7;
    --line-height-loose: 2;

    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Border Radius Scale */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-3xl: 24px;
    --radius-full: 9999px;

    /* Semantic Aliases for Light Mode */
    --bg-primary: var(--blueprint-bg-primary);
    --bg-secondary: var(--blueprint-bg-secondary);
    --bg-accent: var(--blueprint-bg-accent);
    --text-primary: var(--blueprint-text-primary);
    --text-secondary: var(--blueprint-text-secondary);
    --text-muted: var(--blueprint-text-muted);
    --border-color: var(--blueprint-border);
    --shadow-color: var(--shadow-medium);
    --code-bg: #1E293B;
    --code-text: #F1F5F9;
    --gradient-start: var(--blueprint-sky);
    --gradient-end: var(--blueprint-purple);
    --slide-bg: var(--blueprint-bg-secondary);
    --slide-bg-rgb: 255, 255, 255; /* RGB values for transparency */
    --nav-bg: var(--blueprint-sky);
    --nav-text: #FFFFFF;
    --button-hover: var(--blueprint-sky-dark);
}

/* Dark Mode Variables - Blueprint Theme */
[data-theme="dark"] {
    /* Primary Blueprint Colors - Dark Mode */
    --blueprint-bg-primary: #0F172A;
    --blueprint-bg-secondary: #1E293B;
    --blueprint-bg-accent: #334155;
    --blueprint-text-primary: #F1F5F9;
    --blueprint-text-secondary: #CBD5E1;
    --blueprint-text-muted: #94A3B8;

    /* Accent Colors - Brighter for Dark Mode */
    --blueprint-sky: #38BDF8;
    --blueprint-sky-light: #7DD3FC;
    --blueprint-sky-dark: #0EA5E9;
    --blueprint-purple: #A78BFA;
    --blueprint-purple-light: #C4B5FD;
    --blueprint-purple-dark: #8B5CF6;

    /* Border & Grid Colors */
    --blueprint-border: #334155;
    --blueprint-grid: rgba(51, 65, 85, 0.3);

    /* Semantic Colors - Dark Mode */
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-border: #34D399;
    --success-text: #6EE7B7;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-border: #FBBF24;
    --warning-text: #FCD34D;
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-border: #F87171;
    --error-text: #FCA5A5;

    /* Shadow Colors */
    --shadow-light: rgba(0, 0, 0, 0.2);
    --shadow-medium: rgba(0, 0, 0, 0.3);
    --shadow-heavy: rgba(0, 0, 0, 0.4);

    /* Semantic Aliases for Dark Mode */
    --bg-primary: var(--blueprint-bg-primary);
    --bg-secondary: var(--blueprint-bg-secondary);
    --bg-accent: var(--blueprint-bg-accent);
    --text-primary: var(--blueprint-text-primary);
    --text-secondary: var(--blueprint-text-secondary);
    --text-muted: var(--blueprint-text-muted);
    --border-color: var(--blueprint-border);
    --shadow-color: var(--shadow-medium);
    --code-bg: #0F172A;
    --code-text: #E2E8F0;
    --gradient-start: var(--blueprint-sky-dark);
    --gradient-end: var(--blueprint-purple-dark);
    --slide-bg: var(--blueprint-bg-secondary);
    --slide-bg-rgb: 30, 41, 59; /* RGB values for transparency */
    --nav-bg: var(--blueprint-bg-accent);
    --nav-text: var(--blueprint-text-primary);
    --button-hover: var(--blueprint-sky);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
    background: #7BA5CC;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    transition: background 0.3s ease;
    position: relative;
}

/* Blueprint grid overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(230, 240, 250, 0.6) 1px, transparent 1px),
        linear-gradient(90deg, rgba(230, 240, 250, 0.6) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0.7;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* Top Controls Container - Merged Theme Toggle + Title/Home */
.top-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(var(--slide-bg-rgb), 0.65);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 10px var(--shadow-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--border-color);
    transition: opacity 0.3s ease, transform 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.timer-row {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(var(--blueprint-purple), 0.15);
    border-radius: 20px;
    border: 1px solid var(--blueprint-purple);
}

.timer-icon {
    font-size: 1.2em;
}

.timer-text {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
    font-family: 'Courier New', monospace;
}

.timer-stop-btn {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.timer-stop-btn:hover {
    background: var(--error-border);
    color: white;
}

.top-controls.controls-hidden {
    opacity: 0;
    transform: translateX(calc(100% - 50px));
    pointer-events: none;
}

.top-controls.controls-hidden .control-tab {
    pointer-events: all;
    opacity: 1;
}

.control-tab {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    background: rgba(var(--slide-bg-rgb), 0.8);
    backdrop-filter: blur(10px);
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-right: none;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease;
}

.top-controls.controls-hidden .control-tab {
    opacity: 0.7;
}

.control-tab:hover {
    background: rgba(var(--slide-bg-rgb), 0.95);
    opacity: 1 !important;
}

.lecture-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
    color: var(--text-primary);
    font-weight: 500;
}

/* Theme Toggle Switch */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle-label {
    color: var(--text-primary);
    font-size: 0.9em;
    user-select: none;
}

.theme-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--blueprint-sky-light);
    transition: .4s;
    border-radius: 30px;
}

.theme-slider:before {
    position: absolute;
    content: "☀️";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

input:checked + .theme-slider {
    background-color: var(--blueprint-purple-dark);
}

input:checked + .theme-slider:before {
    transform: translateX(30px);
    content: "🌙";
}

/* Presentation Container */
.presentation-container {
    width: 90vw;
    height: 90vh;
    background: var(--slide-bg);
    border-radius: 20px;
    box-shadow:
        0 20px 60px var(--shadow-color),
        0 0 0 1px var(--blueprint-border);
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease;
    backdrop-filter: blur(10px);
}

/* Slide Styles */
.slide {
    width: 100%;
    height: 100%;
    padding: 60px;
    display: none;
    flex-direction: column;
    animation: slideIn 0.5s ease-in-out;
    overflow-y: auto;
    background: var(--slide-bg);
    color: var(--text-primary);
}

.slide.active {
    display: flex;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Screen shake animation for timer alarm */
@keyframes shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-10px, -5px) rotate(-2deg); }
    20% { transform: translate(10px, 5px) rotate(2deg); }
    30% { transform: translate(-10px, 5px) rotate(-2deg); }
    40% { transform: translate(10px, -5px) rotate(2deg); }
    50% { transform: translate(-10px, -5px) rotate(-2deg); }
    60% { transform: translate(10px, 5px) rotate(2deg); }
    70% { transform: translate(-10px, 5px) rotate(-2deg); }
    80% { transform: translate(10px, -5px) rotate(2deg); }
    90% { transform: translate(-10px, -5px) rotate(-2deg); }
}

.presentation-container.shake {
    animation: shake 2s ease-in-out;
}

.home a{
    color:white;
    text-decoration: none;
}

/* Typography */
h1 {
    font-family: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
    color: var(--blueprint-sky-dark);
    font-size: 2.8em;
    font-weight: 700;
    margin-bottom: 30px;
    border-bottom: 3px solid var(--border-color);
    padding-bottom: 20px;
    transition: color 0.3s ease;
}

[data-theme="dark"] h1 {
    color: var(--blueprint-sky-light);
}

h2 {
    font-family: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
    color: var(--blueprint-text-primary);
    font-size: 2.2em;
    font-weight: 600;
    margin-bottom: 25px;
    margin-top: 30px;
    transition: color 0.3s ease;
}

[data-theme="dark"] h2 {
    color: var(--blueprint-text-primary);
}

h3 {
    font-family: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
    color: var(--text-secondary);
    font-size: 1.6em;
    font-weight: 600;
    margin: 20px 0;
    transition: color 0.3s ease;
}

p, li {
    font-size: 1.2em;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

ul, ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 12px;
}

/* Code Examples */
.code-example {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    margin: 20px 0;
    font-size: 1.1em;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: all 0.3s ease;
}

.code-example .tag {
    color: #F59E0B;
}

.code-example .attribute {
    color: #10B981;
}

.code-example .value {
    color: var(--blueprint-sky-light);
}

[data-theme="dark"] .code-example .value {
    color: var(--blueprint-sky-light);
}

.code-example .content {
    color: var(--code-text);
}

.code-example .comment {
    color: var(--text-muted);
    font-style: italic;
}

.code-example .good {
    color: var(--success-border);
}

.code-example .bad {
    color: var(--error-border);
}

/* Utility Classes */
.highlight {
    background: linear-gradient(120deg, var(--blueprint-sky) 0%, var(--blueprint-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.emoji {
    font-size: 1.3em;
    margin: 0 8px;
}

/* Box Components */
.activity-box {
    background: linear-gradient(135deg, var(--blueprint-sky) 0%, var(--blueprint-purple) 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
    box-shadow:
        0 4px 10px var(--shadow-color),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .activity-box {
    background: linear-gradient(135deg, var(--blueprint-sky-dark) 0%, var(--blueprint-purple-dark) 100%);
}

.activity-box h3 {
    color: white;
    margin-bottom: 15px;
}

.activity-box p,
.activity-box li {
    color: white;
}

.visual-example {
    background: var(--bg-accent);
    border: 2px dashed var(--border-color);
    padding: 30px;
    border-radius: 10px;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.tip-box, .tip {
    background: var(--success-bg);
    border-left: 4px solid var(--success-border);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.warning-box, .warning {
    background: var(--warning-bg);
    border-left: 4px solid var(--warning-border);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.demo-box {
    background: var(--bg-accent);
    border: 2px dashed var(--border-color);
    padding: 30px;
    border-radius: 15px;
    margin: 25px 0;
    text-align: center;
    transition: all 0.3s ease;
}

/* Layout Utilities */
.comparison-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.comparison-card {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 10px;
    border-top: 4px solid var(--border-color);
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: all 0.3s ease;
}

.comparison-card.bad {
    background: rgba(255, 85, 85, 0.1);
    border-left: 4px solid #ff5555;
}

.comparison-card.good {
    background: var(--success-bg);
    border-left: 4px solid var(--success-border);
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 30px 0;
}

/* Navigation Controls */
.navigation {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 20px;
    align-items: center;
    z-index: 100;
    background: rgba(var(--slide-bg-rgb), 0.65);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 30px;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.navigation.controls-hidden {
    opacity: 0;
    transform: translateX(calc(100% - 50px));
    pointer-events: none;
}

.navigation.controls-hidden .nav-tab {
    pointer-events: all;
    opacity: 1;
}

.nav-tab {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    background: rgba(var(--slide-bg-rgb), 0.8);
    backdrop-filter: blur(10px);
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-right: none;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease;
}

.navigation.controls-hidden .nav-tab {
    opacity: 0.7;
}

.nav-tab:hover {
    background: rgba(var(--slide-bg-rgb), 0.95);
    opacity: 1 !important;
}

button {
    background: var(--nav-bg);
    color: var(--nav-text);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    opacity: 0.5;
}

.slide-counter {
    font-size: 1.1em;
    color: var(--text-primary);
    font-weight: bold;
    margin: 0 10px;
}

/* Legacy timer styles - kept for compatibility but hidden */
.timer, .timer-display {
    display: none;
}

/* Inline Code */
code {
    background: var(--bg-accent);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: var(--blueprint-sky-dark);
    transition: all 0.3s ease;
}

[data-theme="dark"] code {
    color: var(--blueprint-sky-light);
}

/* Special List Styles */
.icon-list {
    list-style: none;
    margin-left: 0;
}

.icon-list li::before {
    content: "→ ";
    color: var(--blueprint-sky);
    font-weight: bold;
    margin-right: 10px;
}

[data-theme="dark"] .icon-list li::before {
    color: var(--blueprint-sky-light);
}

/* Scrollbar Styling */
.slide::-webkit-scrollbar {
    width: 10px;
}

.slide::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

.slide::-webkit-scrollbar-thumb {
    background: var(--blueprint-sky);
    border-radius: 10px;
}

.slide::-webkit-scrollbar-thumb:hover {
    background: var(--blueprint-sky-dark);
}

[data-theme="dark"] .slide::-webkit-scrollbar-thumb {
    background: var(--blueprint-sky-light);
}

[data-theme="dark"] .slide::-webkit-scrollbar-thumb:hover {
    background: var(--blueprint-sky);
}

/* Responsive Design */
@media (max-width: 768px) {
    .presentation-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .slide {
        padding: 30px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    h2 {
        font-size: 1.6em;
    }
    
    .comparison-table,
    .two-column {
        grid-template-columns: 1fr;
    }
    
    .navigation {
        bottom: 20px;
        right: 20px;
        padding: 10px 15px;
    }

    button {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .top-controls {
        top: 10px;
        right: 10px;
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .timer-text {
        font-size: 1.1em;
        min-width: 70px;
    }

    .timer-stop-btn {
        padding: 3px 10px;
        font-size: 0.85em;
    }

    .control-tab,
    .nav-tab {
        width: 30px;
        height: 50px;
        font-size: 1em;
    }
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}