/* Smart Mirror Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --secondary-color: #7c8799;
    --success-color: #5cb85c;
    --danger-color: #e74c3c;
    --warning-color: #f0ad4e;
    --dark-bg: #000000;
    --card-bg: rgba(20, 20, 20, 0.8);
    --light-bg: rgba(40, 40, 40, 0.6);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    --recording-red: #ff4444;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #000000; /* Pure black for mirror reflection */
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

body.smart-mirror {
    background: #000000; /* Pure black for mirror reflection */
}

/* Mirror Container - Full screen black background */
.mirror-container {
    width: 100vw;
    height: 100vh;
    background: #000000; /* Pure black for mirror reflection */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Centered Content Area */
.content-center {
    max-width: clamp(342px, 46.875vw, 900px);
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(16px, 1.85vh, 24px);
}

/* Guideline Container - Combined Sphere + Rotation Indicator */
.guideline-container {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 17vh;
    z-index: 10;
    pointer-events: none;
}

.guideline-combined {
    width: auto;
    height: 52vh;
    max-height: 812px;
    opacity: 1;
}

/* Instruction Text Box - Glassmorphic Style */
.instruction-box {
    max-width: 1266px;
    width: 90vw;
    min-height: clamp(90px, 15vh, 154px);
    padding: clamp(16px, 2.5vh, 29px) clamp(28px, 4vw, 48px);
    border-radius: clamp(10px, 1.2vw, 14px);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.15) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0px 12px 24px 0px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.instruction-text {
    margin: 0;
    font-size: clamp(20px, 3.4vw, 34px);
    font-weight: 600;
    line-height: 140%;
    letter-spacing: clamp(0.8px, 0.12vw, 1.2px);
    color: #FFFFFF;
    text-align: center;
    width: 100%;
    max-width: 1170px;
}

/* Top Right Navigation - HOME Button */
.top-right-nav {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    gap: 16px;
}

.home-nav-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 21.6px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.home-nav-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

/* Left Side Controls - Vertical Button Group */
.left-controls {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 38.4px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.6);
    width: auto;
    height: auto;
    border-radius: 62.4px;
    backdrop-filter: blur(10px);
    padding: 14.4px 16px;
    align-items: center;
    justify-content: center;
}

/* Right Side Controls - Recording Button */
.right-controls {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

/* Control Button Base Style */
.control-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: scale(1.1);
}

.control-btn svg {
    width: 28px;
    height: 28px;
}

/* Left Controls Button Specific Styles */
.left-controls .control-btn {
    width: 91.2px;
    max-width: 91.2px;
    height: 91.2px;
    border-radius: 50%;
    background: transparent !important;
    backdrop-filter: none !important;
    border: none;
    color: #757575;
    font-size: 21.6px;
    font-weight: 700;
    padding: 0 12px;
    text-transform: lowercase;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.left-controls .control-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px) !important;
    color: #757575;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 6px 16px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.left-controls .control-btn.active {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    transition: background 0.5s ease, backdrop-filter 0.5s ease !important;
}

.left-controls .control-btn svg {
    display: none;
}

/* Recording Button Special Styling */
.control-btn.record-btn {
    width: clamp(85px, 6.06vw, 140px);
    height: clamp(85px, 6.06vw, 140px);
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

.control-btn.record-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.control-btn.record-btn .camera-icon {
    width: clamp(42px, 3vw, 72px);
    height: clamp(42px, 3vw, 72px);
    object-fit: contain;
    filter: brightness(1.2);
}

/* Stop Button Styling */
.control-btn.stop-btn {
    width: clamp(85px, 6.06vw, 140px);
    height: clamp(85px, 6.06vw, 140px);
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

.control-btn.stop-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.control-btn.stop-btn svg {
    width: clamp(42px, 3vw, 72px);
    height: clamp(42px, 3vw, 72px);
    fill: #3D3D3D;
}

/* Home Button Styling */
.control-btn.home-btn {
    width: clamp(85px, 6.06vw, 140px);
    height: clamp(85px, 6.06vw, 140px);
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

.control-btn.home-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.control-btn.home-btn svg {
    width: clamp(42px, 3vw, 72px);
    height: clamp(42px, 3vw, 72px);
    fill: #3D3D3D;
}

/* Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.settings-modal {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
}

.settings-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.settings-content {
    padding: 20px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.setting-item select {
    width: 100%;
    padding: 10px;
    background: rgba(40, 40, 40, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-item select:hover,
.setting-item select:focus {
    background: rgba(50, 50, 50, 0.95);
    border-color: var(--primary-color);
    outline: none;
}

.setting-item.checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-primary);
}

.setting-item.checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

/* Video Container */
.video-container {
    display: none;
}



#playbackVideo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    background: #000;
    z-index: 1;
    display: block;
    pointer-events: none;
}

/* Playback Controls Overlay (on video) */
.playback-controls-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.playback-controls-overlay.auto-hide {
    opacity: 0;
}

.overlay-btn {
    width: clamp(96px, 11.86vmin, 128px);
    height: clamp(96px, 11.86vmin, 128px);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.overlay-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.1);
}

.overlay-btn svg {
    width: clamp(36px, 4.44vmin, 48px);
    height: clamp(36px, 4.44vmin, 48px);
}

/* Video Controls Section */
.video-controls-section {
    position: fixed;
    bottom: clamp(40px, 5vh, 72px);
    left: 50%;
    transform: translateX(-50%);
    width: clamp(416px, 62.66vw, 1203.8px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(10.4px, 1.44vh, 15.6px);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: clamp(13px, 1.81vh, 19.5px);
    padding: clamp(13px, 1.81vh, 19.5px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.scrubber-container {
    width: 100%;
}

.scrubber-timeline {
    position: relative;
    width: 100%;
    height: clamp(104px, 12.64vh, 136.5px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: clamp(10.4px, 1.21vh, 13px);
    overflow: visible;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.thumbnail-strip {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    opacity: 0.8;
    overflow: hidden;
    border-radius: 13px;
}

.thumbnail-item {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scrubber-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.scrubber-progress {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(74, 144, 226, 0.7), rgba(92, 184, 92, 0.7));
    width: 0;
    transform-origin: left;
    will-change: transform;
}

.scrubber-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    transform: translateX(0);
    will-change: transform;
    pointer-events: none;
}

.time-display {
    text-align: center;
    font-size: clamp(18.2px, 2.17vh, 23.4px);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    letter-spacing: 0.65px;
}

/* Timeline Orientation Markers */
.orientation-marker {
    position: absolute;
    bottom: 100%;
    transform: translateX(-50%);
    width: clamp(104px, 14.43vmin, 156px);
    height: clamp(104px, 14.43vmin, 156px);
    margin-bottom: clamp(2.6px, 0.48vh, 5.2px);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 250;
}

.orientation-marker svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.orientation-marker:hover {
    transform: translateX(-50%) scale(1.2);
}

.orientation-marker:hover::after {
    content: attr(data-label);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    margin-bottom: 4px;
    pointer-events: none;
}

.orientation-marker.active {
    transform: translateX(-50%) scale(1.3);
}

.orientation-marker.active svg {
    filter: drop-shadow(0 0 8px rgba(74, 144, 226, 0.8));
}

/* Marker icons color coding */
.orientation-marker.front svg { fill: #4a90e2; }
.orientation-marker.back svg { fill: #e74c3c; }
.orientation-marker.left svg { fill: #f0ad4e; }
.orientation-marker.right svg { fill: #5cb85c; }

/* Control Buttons - Positioned at bottom of screen */
.control-buttons-bottom {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    z-index: 500;
}

/* Floating Buttons */
.btn-floating {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.btn-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.7);
}

.btn-record {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.3);
}

.btn-record:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.5);
}

.btn-stop {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.5);
}

.btn-stop svg {
    width: 32px;
    height: 32px;
}

.btn-new,
.btn-download {
    background: rgba(74, 144, 226, 0.1);
    border-color: rgba(74, 144, 226, 0.3);
}

.btn-new:hover,
.btn-download:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: rgba(74, 144, 226, 0.5);
}

.btn-new svg,
.btn-download svg {
    width: 32px;
    height: 32px;
}

/* Minimal Recording Indicator */
.minimal-recording-indicator {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 37.5px;
    z-index: 100;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.minimal-recording-indicator .recording-dot {
    width: 18px;
    height: 18px;
    background: var(--recording-red);
    border-radius: 50%;
    animation: recordingPulse 1.5s ease-in-out infinite;
}

.minimal-recording-indicator .recording-timer {
    font-size: 21px;
    color: white;
    font-weight: 500;
}

@keyframes recordingPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* Spinner for modals */
.spinner-small {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(74, 144, 226, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Countdown Overlay */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.countdown-number {
    font-size: 192px;
    font-weight: 300;
    color: white;
    animation: countdownPulse 1s ease-in-out;
    text-shadow: 0 0 60px rgba(255, 255, 255, 0.3);
}

@keyframes countdownPulse {
    0% {
        transform: scale(1.5);
        opacity: 0;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.8;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(74, 144, 226, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Utility Classes */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #3a7bc8;
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Legacy Support - Hide old elements */
.container,
.main-content,
.content-wrapper,
.video-section,
.controls-section,
.main-controls,
.settings-panel,
.info-panel,
.info-card,
.stats-grid,
.analysis-side-panel {
    display: none !important;
}

/* Recording indicator for debug mode */
.recording-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    border-radius: 37.5px;
    z-index: 10;
}

.recording-indicator .recording-dot {
    width: 18px;
    height: 18px;
    background: var(--recording-red);
    border-radius: 50%;
    animation: recordingPulse 1.5s ease-in-out infinite;
}

.recording-indicator .recording-text {
    font-size: 21px;
    color: white;
}

.recording-indicator .recording-timer {
    font-size: 21px;
    color: white;
    font-weight: 500;
}

/* Responsive Design */

/* Medium Laptops (1366px and below) */
@media (max-width: 1366px) {

    .left-controls,
    .right-controls {
        gap: 24px;
    }

    .action-btn {
        width: 200px;
        font-size: 17px;
    }

    .mode-panel {
        max-width: 480px;
    }

    /* Guideline responsive scaling */
    .guideline-container {
        gap: 16vh;
    }

    .guideline-combined {
        height: 65vh;
        max-height: 730px;
    }
}

/* Small Laptops (1024px and below) - Minimum supported resolution */
@media (max-width: 1024px) {

    .left-controls {
        width: auto;
        height: auto;
        gap: 24px;
        border-radius: 51.6px;
    }

    .left-controls .control-btn {
        width: 80.4px;
        height: 80.4px;
        font-size: 19.2px;
    }

    .action-btn {
        width: 180px;
        height: 48px;
        font-size: 16px;
    }

    .mode-panel {
        max-width: 420px;
        min-height: 240px;
        padding: 20px 28px;
    }

    .mode-label {
        font-size: 18px;
    }

    .mode-option {
        width: 130px;
        height: 50px;
        font-size: 18px;
    }

    .orientation-marker {
        width: 100px;
        height: 100px;
    }

    /* Guideline responsive scaling */
    .guideline-container {
        gap: 15vh;
    }

    .guideline-combined {
        height: 60vh;
        max-height: 677px;
    }
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
    .content-center {
        width: 95%;
    }

    .btn-floating {
        width: 70px;
        height: 70px;
    }

    .countdown-number {
        font-size: 144px;
    }

    .orientation-badge img {
        width: 60px;
        height: 60px;
    }

    /* Adjust control buttons position for smaller screens */
    .left-controls {
        left: 0;
    }

    /* Adjust timeline width for tablet */
    .video-controls-section {
        width: clamp(364px, 110.5vw, 780px);
        bottom: clamp(40px, 5vh, 60px);
    }

    /* Guideline responsive scaling */
    .guideline-container {
        gap: 12vh;
    }

    .guideline-combined {
        height: 50vh;
        max-height: 540px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    /* Adjust HOME button for mobile */
    .home-nav-btn {
        font-size: 18px;
        padding: 6px 10px;
    }

    /* Further adjust controls */
    .left-controls,
    .right-controls {
        gap: 15px;
    }

    .control-btn {
        width: 56px;
        height: 56px;
    }

    /* Adjust timeline and markers for mobile */
    .video-controls-section {
        width: 100vw;
    }

    .orientation-marker {
        width: clamp(78px, 19.5vmin, 104px);
        height: clamp(78px, 19.5vmin, 104px);
    }

    /* Guideline responsive scaling */
    .guideline-container {
        gap: 8vh;
    }

    .guideline-combined {
        height: 40vh;
        max-height: 400px;
    }
}

/* Hide elements that shouldn't be visible in smart mirror mode */
.preview-hidden {
    display: none !important;
}

/* Mode Panel Overlay */
.mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.mode-panel {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    width: 90%;
    max-width: 538px;
    min-height: 264px;
    border-radius: 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 24px 32px;
    margin-left: calc(10px + 16px + 91.2px + 16px + 30px); /* left-controls (10px + left padding + button + right padding) + gap (30px) = 163.2px */
    animation: slideIn 0.3s ease;
}

.mode-row {
    display: flex;
    align-items: center;
    gap: 24px;
}

.mode-label {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 100%;
    color: rgba(0, 0, 0, 0.8);
    min-width: 100px;
}

.mode-options {
    display: flex;
    gap: 10px;
}

.mode-option {
    width: 150px;
    height: 57px;
    border-radius: 43px;
    padding: 9px 17px;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(124, 124, 124, 0.38);
    color: rgba(0, 0, 0, 0.7);
}

.mode-option.active {
    background: rgba(255, 255, 255, 0.52);
    color: rgba(0, 0, 0, 0.9);
}

.mode-option:hover {
    transform: scale(1.05);
}

.mode-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.mode-option.disabled:hover {
    transform: none;
}

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

/* Mobile adjustments for mode panel */
@media (max-width: 768px) {
    .mode-panel {
        width: 400px; /* Narrower panel for mobile */
        height: auto;
        padding: 20px 24px;
        margin-left: calc(10px + 16px + 91.2px + 16px + 30px); /* Mobile: left-controls (10px + padding + button + padding) + gap */
    }

    .mode-option {
        width: 120px; /* Smaller buttons */
        height: 48px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .mode-panel {
        width: calc(100% - 40px); /* Almost full width with margins */
        max-width: 350px;
        margin-left: 20px; /* Align with left edge on very small screens */
    }

    .mode-row {
        flex-direction: column; /* Stack label and options vertically */
        align-items: flex-start;
        gap: 8px;
    }

    .mode-label {
        min-width: auto;
    }
}

/* Gallery Panel Overlay */
.gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.gallery-panel {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    width: 90%;
    max-width: 538px;
    min-height: 264px;
    border-radius: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 32px;
    margin-left: calc(10px + 16px + 91.2px + 16px + 30px); /* left-controls (10px + left padding + button + right padding) + gap (30px) = 163.2px */
    animation: slideIn 0.3s ease;
}

.gallery-tbd-text {
    font-size: 32px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.8);
    margin: 0;
}

/* Mobile adjustments for gallery panel */
@media (max-width: 768px) {
    .gallery-panel {
        width: 400px;
        height: auto;
        padding: 20px 24px;
        margin-left: calc(10px + 16px + 91.2px + 16px + 30px); /* Mobile: left-controls (10px + padding + button + padding) + gap */
    }
}

@media (max-width: 480px) {
    .gallery-panel {
        width: calc(100% - 40px);
        max-width: 350px;
        margin-left: 20px; /* Align with left edge on very small screens */
    }
}