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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background: #121212;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Fixed Header Bar */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #1a1a1a;
    border-bottom: 2px solid #404040;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1002;
    gap: 20px;
}

.slide-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
    flex-grow: 1;
}

/* Burger Menu */
.burger-menu {
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 4px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Fullscreen Button */
.fullscreen-btn {
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 4px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    color: #e0e0e0;
}

.fullscreen-btn:hover,
.burger-menu:hover {
    background: #3a3a3a;
}

/* Slide Navigation Buttons */
.slide-nav-btn {
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 4px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    color: #e0e0e0;
    font-size: 24px;
}

.slide-nav-btn:hover {
    background: #3a3a3a;
}

.slide-nav-btn:disabled {
    background: #1a1a1a;
    color: #555;
    cursor: not-allowed;
}

.burger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background: #e0e0e0;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #1e1e1e;
    border-right: 2px solid #404040;
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-content {
    padding: 80px 30px 30px;
}

.sidebar h1 {
    color: #ffffff;
    font-size: 1.8rem;
    text-shadow: none;
    margin-bottom: 30px;
    font-weight: 300;
    text-align: center;
}

.sidebar-tabs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar .tab-button {
    background: #2a2a2a;
    border: 1px solid #404040;
    color: #e0e0e0;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.sidebar .tab-button:hover {
    background: #3a3a3a;
    border-color: #555;
    transform: translateY(-1px);
}

.sidebar .tab-button.active {
    background: #007acc;
    border-color: #0099ff;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 122, 204, 0.3);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.container {
    max-width: 95vw; /* Use 95% of viewport width instead of fixed pixel limit */
    width: 100%;
    margin: 0 auto;
    padding: 90px 20px 20px; /* Increased top padding for header bar */
    transition: all 0.3s ease;
}

/* Fullscreen mode adjustments */
:fullscreen .container,
:-webkit-full-screen .container,
:-moz-full-screen .container {
    max-width: none;
    padding: 90px 40px 40px;
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
}

:fullscreen canvas,
:-webkit-full-screen canvas,
:-moz-full-screen canvas {
    max-width: calc(100vw - 80px);
    max-height: calc(100vh - 200px);
    width: auto;
    height: auto;
}

:fullscreen .simulation-container,
:-webkit-full-screen .simulation-container,
:-moz-full-screen .simulation-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Fullscreen icon change */
:fullscreen .fullscreen-btn svg,
:-webkit-full-screen .fullscreen-btn svg,
:-moz-full-screen .fullscreen-btn svg {
    transform: rotate(180deg);
}
    border-radius: 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Lecture Content */
.lecture-content {
    position: relative;
}

.lecture {
    display: none;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: hidden;
}

.lecture.active {
    display: block;
}

/* Hide slide metadata from main view (but keep in DOM for header) */
.slide-content .slide-counter,
.slide-content h2,
.slide-content > p:first-of-type {
    display: none !important;
}

/* Simulation Layout */
.simulation-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    max-width: none;
}

.simulation-layout canvas {
    width: 80%;
    max-width: 80%;
    height: auto;
    flex-shrink: 0;
    border: 2px solid #404040;
    border-radius: 4px;
}

.simulation-controls-panel {
    width: 20%;
    max-width: 20%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #1e1e1e;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 20px;
    box-sizing: border-box;
}

/* Slideshow Container */
.slideshow-container {
    position: relative;
    min-height: 500px;
}

.slide {
    display: none;
    padding: 20px 10px; /* Reduced from 40px to allow more width */
    min-height: 500px;
    background: transparent;
    position: relative;
}

.slide.active {
    display: block;
    animation: slideIn 0.5s ease-in-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-content {
    width: 100%;
    margin: 0;
}

.slide-content h2 {
    color: #ffffff;
    font-size: 2rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #888888;
    padding-bottom: 10px;
    font-weight: 300;
    display: inline-block;
    width: calc(100% - 80px);
    vertical-align: top;
}

.slide-content p {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #cccccc;
}

.slide-content ul {
    margin: 20px 0;
    padding-left: 30px;
}

.slide-content li {
    margin-bottom: 8px;
    font-size: 1.05rem;
    color: #b0b0b0;
}

.slide-image-placeholder {
    background: #1a1a1a;
    border: 1px dashed #404040;
    padding: 40px;
    text-align: center;
    margin: 20px 0;
    color: #888888;
    font-style: italic;
}

.highlight-box {
    background: #2a2a1a;
    border: 1px solid #4a4a2a;
    padding: 20px;
    margin: 20px 0;
    border-left: 3px solid #ffff00;
}

.highlight-box p {
    margin: 0;
    font-weight: 600;
    color: #cccccc;
}

blockquote {
    background: #1a1a1a;
    border-left: 3px solid #888888;
    border: 1px solid #404040;
    padding: 20px;
    margin: 20px 0;
    font-style: italic;
    font-size: 1.1rem;
    color: #cccccc;
}

/* Slide Arrow Navigation */
.slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 500px;
    background: rgba(42, 42, 42, 0.8);
    border: 1px solid #606060;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.slide-arrow:hover {
    background: rgba(64, 64, 64, 0.9);
    border-color: #808080;
}

.slide-arrow-left {
    left: 10px;
}

.slide-arrow-right {
    right: 10px;
}

.arrow-icon {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.slide-counter {
    display: inline-block;
    color: #e0e0e0;
    font-weight: 600;
    background: #2a2a2a;
    border: 1px solid #404040;
    padding: 20px 15px;
    margin-right: 15px;
    font-size: 0.9rem;
    vertical-align: top;
    margin-top: 0px;
}

.current-slide {
    color: #ffffff;
    font-weight: 700;
}

/* Random Walk Simulation Styles */
.simulation-container {
    background: #2a2a2a;
    border: 1px solid #404040;
    padding: 0;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.simulation-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.simulation-controls:last-child {
    margin-bottom: 0;
}

/* Horizontal layout for buttons within control groups */
.control-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.control-row .sim-btn {
    flex: 1;
    min-width: 0;
}

.sim-btn {
    background: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #404040;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 80px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sim-btn:hover:not(:disabled) {
    border-color: #606060;
}

.start-btn {
    background: #1a4d1a;
    border-color: #2d7b2d;
}

.start-btn:hover:not(:disabled) {
    background: #2d6b2d;
    border-color: #4d9b4d;
}

.stop-btn {
    background: #4d1a1a;
    border-color: #7b2d2d;
}

.stop-btn:hover:not(:disabled) {
    background: #6b2d2d;
    border-color: #9b4d4d;
}

.reset-btn {
    background: #4d4d1a;
    border-color: #7b7b2d;
}

.reset-btn:hover:not(:disabled) {
    background: #6b6b2d;
    border-color: #9b9b4d;
}

.speed-btn {
    background: #4d1a4d;
    border-color: #7b2d7b;
}

.speed-btn:hover:not(:disabled) {
    background: #6b2d6b;
    border-color: #9b4d9b;
}

.sim-btn:disabled {
    background: #0f0f0f;
    color: #666666;
    border-color: #333333;
    cursor: not-allowed;
    transform: none;
}

.simulation-info {
    display: none;
}

.info-item {
    background: #1a1a1a;
    padding: 8px 15px;
    border: 1px solid #404040;
    font-size: 0.9rem;
    color: #e0e0e0;
}

.info-label {
    font-weight: 600;
    color: #b0b0b0;
    margin-right: 5px;
}

#randomWalkCanvas, #randomWalkCanvas2 {
    border: none;
    display: block;
    margin: 0;
    background: #121212;
    cursor: crosshair;
    width: 100%;
    height: 450px;
}

.simulation-description {
    margin-top: 10px;
    padding: 15px;
    background: #1a1a1a;
    border: 1px solid #404040;
    border-left: 3px solid #888888;
}

.simulation-description p {
    margin: 0;
    font-size: 0.95rem;
    color: #cccccc;
}

/* Responsive adjustments for simulation */
@media (max-width: 768px) {
    .simulation-container {
        padding: 15px;
    }
    
    #randomWalkCanvas, #randomWalkCanvas2 {
        width: 100%;
        height: auto;
        max-width: 100%;
    }
    
    .simulation-info {
        gap: 15px;
    }
    
    .info-item {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-button {
        width: 200px;
        text-align: center;
    }
    
    .slide {
        padding: 20px;
        min-height: 400px;
    }
    
    .slide-content h2 {
        font-size: 1.5rem;
    }
    
    .slide-arrow {
        width: 50px;
        height: 100px;
    }
    
    .slide-arrow-left {
        left: 10px;
    }
    
    .slide-arrow-right {
        right: 10px;
    }
    
    .arrow-icon {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .slide {
        padding: 15px;
    }
    
    .slide-content h2 {
        font-size: 1.3rem;
    }
    
    .slide-content p {
        font-size: 1rem;
    }
}

/* Additional fullscreen layout adjustments for simulation-layout */
:fullscreen .simulation-layout,
:-webkit-full-screen .simulation-layout,
:-moz-full-screen .simulation-layout {
    width: 100%;
    height: calc(100vh - 140px);
    gap: 30px;
    display: flex;
    align-items: flex-start;
}

:fullscreen .simulation-layout canvas,
:-webkit-full-screen .simulation-layout canvas,
:-moz-full-screen .simulation-layout canvas {
    width: 80% !important;
    max-width: 80% !important;
    height: auto;
}

:fullscreen .simulation-controls-panel,
:-webkit-full-screen .simulation-controls-panel,
:-moz-full-screen .simulation-controls-panel {
    width: 15% !important;
    max-width: 15% !important;
    background: rgba(30, 30, 30, 0.95);
}
