/* SPEX Remote View - Web Viewer Styles */

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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent-purple: #8a2be2;
    --accent-blue: #0077ff;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--bg-tertiary);
    margin-bottom: 20px;
}

h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.status.connecting {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

.status.connected {
    background-color: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.status.error {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Video Container */
.video-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    min-height: 400px;
}

.video-player {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.control-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background-color: var(--bg-tertiary);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.muted {
    background-color: var(--error);
}

/* Info Bar */
.info-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat .label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat .value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-secondary);
    font-size: 14px;
    border-top: 1px solid var(--bg-tertiary);
    margin-top: 20px;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--bg-secondary);
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
}

.modal-content h2 {
    margin-bottom: 16px;
    color: var(--error);
}

.modal-content p {
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.modal-content button {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    background-color: var(--accent-purple);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-content button:hover {
    background-color: #7a25d0;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 12px;
    }

    header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    h1 {
        font-size: 20px;
    }

    .video-container {
        min-height: 300px;
    }

    .info-bar {
        gap: 20px;
    }

    .control-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* Fullscreen styles */
:fullscreen .container {
    max-width: none;
    padding: 0;
}

:fullscreen header,
:fullscreen footer,
:fullscreen .info-bar,
:fullscreen .controls {
    display: none;
}

:fullscreen .video-container {
    border-radius: 0;
    min-height: 100vh;
}
