/* ClassZen - Main Styles */

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

:root {
    /* RCNR Kraken Palette */
    --deep-sea: #001628;
    --midnight: #000C17;
    --ice: #99D9D9;
    --ice-muted: #68A2B9;

    /* Widget behavior */
    --translucency: 0.7;
    --passive-multiplier: 0.5;
    --focused-opacity: 0.95;
    --glass-blur: 20px;
    --glass-bg: rgba(153, 217, 217, 0.08);
    --glass-border: rgba(153, 217, 217, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition-duration: 0.4s;
    --widget-radius: 16px;
    --text-color: #ffffff;
    --text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    --accent-color: var(--ice);
    --accent-muted: var(--ice-muted);
    --danger-color: #ff6b6b;
    --success-color: #6bffb8;
    --warning-color: #ffd666;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--midnight);
    color: var(--text-color);
}

/* Video Container */
#video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: var(--deep-sea);
}

#nature-video,
#nature-video-next {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    transition: opacity 1.5s ease-in-out;
}

/* Drawing Canvas */
#drawing-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

#drawing-canvas.active {
    pointer-events: auto;
    cursor: crosshair;
}

/* Widget Container */
#widget-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

/* Base Widget Styles */
.widget {
    position: absolute;
    pointer-events: auto;
    cursor: move;
    transition:
        opacity var(--transition-duration) ease,
        transform var(--transition-duration) ease,
        box-shadow var(--transition-duration) ease;
}

.widget.hidden {
    display: none !important;
}

.widget .widget-content {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--widget-radius);
    box-shadow: var(--glass-shadow);
    padding: 16px;
    transition: all var(--transition-duration) ease;
}

/* Widget States */
.widget[data-state="passive"] {
    opacity: calc(var(--translucency) * var(--passive-multiplier));
}

.widget[data-state="passive"]:hover {
    opacity: calc(var(--translucency) * 0.8);
}

.widget[data-state="active"] {
    opacity: var(--translucency);
}

.widget[data-state="active"]:hover {
    opacity: calc(var(--translucency) * 1.1);
}

.widget[data-state="focused"] {
    opacity: var(--focused-opacity);
    z-index: 100;
}

.widget[data-state="focused"] .widget-content {
    background: rgba(153, 217, 217, 0.12);
    box-shadow:
        var(--glass-shadow),
        0 0 30px rgba(153, 217, 217, 0.25),
        inset 0 0 20px rgba(153, 217, 217, 0.03);
}

/* Widget Dragging */
.widget.dragging {
    opacity: 0.9 !important;
    z-index: 1000;
    cursor: grabbing;
}

/* Common Widget Elements */
.widget-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-color);
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.widget-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.widget-btn:active {
    transform: translateY(0);
}

/* RCNR Brand - Teacher Toolbox */
.rcnr-brand {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 500;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.rcnr-brand:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.rcnr-brand svg {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Settings Toggle Button */
.settings-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-color);
    cursor: pointer;
    z-index: 500;
    opacity: 0.5;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
}

.settings-toggle svg {
    width: 24px;
    height: 24px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --widget-radius: 12px;
        --glass-blur: 15px;
    }

    .widget .widget-content {
        padding: 12px;
    }
}

@media (max-width: 768px) {
    :root {
        --widget-radius: 10px;
        --glass-blur: 10px;
    }

    .widget .widget-content {
        padding: 10px;
    }

    .settings-toggle {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }
}
