/* 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;
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

body.smart-mirror {
    background: #000000;
}

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

/* Centered Content Area */
.content-center {
    max-width: 900px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Floating Home Button */
.floating-home {
    position: fixed;
    top: 20px;
    right: 104px;
    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;
    z-index: 1000;
}

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

.floating-home svg {
    width: 32px;
    height: 32px;
}

/* Floating Settings Button */
.floating-settings {
    position: fixed;
    top: 20px;
    right: 20px;
    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;
    z-index: 1000;
}

.floating-settings:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.floating-settings svg {
    width: 32px;
    height: 32px;
}

/* Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    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: var(--glass-bg);
    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(255, 255, 255, 0.1);
    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;
}

/* Playback Container */
.playback-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeIn 0.5s ease;
}

.video-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#playbackVideo {
    width: 100%;
    height: auto;
    display: block;
}

/* Playback Overlay */
.playback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-wrapper:hover .playback-overlay {
    opacity: 1;
}

.overlay-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    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;
}

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

.overlay-btn svg {
    width: 24px;
    height: 24px;
}

/* Video Controls Section */
.video-controls-section {
    width: 100%;
}

.scrubber-container {
    width: 100%;
}

.scrubber-timeline {
    position: relative;
    width: 100%;
    height: 60px;
    background: rgba(20, 20, 20, 0.6);
    border-radius: 8px;
    overflow: visible;
    cursor: pointer;
    margin-bottom: 8px;
}

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

.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: 3px;
    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: 20px;
    color: var(--text-secondary);
}

/* Timeline Orientation Markers */
.orientation-marker {
    position: absolute;
    bottom: 100%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.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);
}

.record-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--recording-red);
    box-shadow: 0 0 20px 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: 10px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 25px;
    z-index: 100;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

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

.minimal-recording-indicator .recording-timer {
    font-size: 14px;
    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: 160px;
    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: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 25px;
    z-index: 10;
}

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

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

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

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

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

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

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

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