/**
 * VideoSmart Camera - Core Theme & Design System
 * 
 * Palette:
 * - Pure Black Base: #080808
 * - Dark Surface 1: #121212
 * - Dark Surface 2: #1c1c1c
 * - Border Subtle:  #2c2c2c
 * - VideoSmart Red: #E30613
 * - Red Accent:     #FF1F2D
 * - Pure White:     #FFFFFF
 * - Muted Grey:     #A0A0A0
 * - Tally Program:  #E30613 (Red)
 * - Tally Preview:  #10B981 (Green)
 * 
 * Typography: Archivo & Archivo Black
 */

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Archivo+Black&display=swap');

:root {
    --vs-bg-base: #080808;
    --vs-bg-surface-1: #121212;
    --vs-bg-surface-2: #1a1a1a;
    --vs-bg-surface-3: #242424;
    --vs-border-subtle: #2d2d2d;
    --vs-border-active: #404040;
    
    --vs-red-primary: #E30613;
    --vs-red-hover: #FF1F2D;
    --vs-red-glow: rgba(227, 6, 19, 0.35);

    --vs-text-primary: #FFFFFF;
    --vs-text-secondary: #CCCCCC;
    --vs-text-muted: #8E8E93;
    
    --vs-tally-prog: #E30613;
    --vs-tally-prev: #10B981;
    --vs-tally-off: #4A4A4A;
    --vs-warning: #F59E0B;
    --vs-info: #3B82F6;

    --vs-font-heading: 'Archivo Black', 'Archivo', sans-serif;
    --vs-font-body: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --vs-font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

    --vs-radius-sm: 6px;
    --vs-radius-md: 10px;
    --vs-radius-lg: 16px;
    --vs-radius-pill: 9999px;

    --vs-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --vs-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.6);
    --vs-shadow-glow: 0 0 25px var(--vs-red-glow);
}

/* Reset and base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--vs-bg-base);
    color: var(--vs-text-primary);
    font-family: var(--vs-font-body);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* WordPress fullscreen override when plugin view is active */
body.videosmart-standalone-view {
    overflow: hidden !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 !important;
    margin: 0 !important;
}

body.videosmart-standalone-view #wpadminbar,
body.videosmart-standalone-view header,
body.videosmart-standalone-view footer,
body.videosmart-standalone-view .site-header,
body.videosmart-standalone-view .site-footer {
    display: none !important;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--vs-font-heading);
    letter-spacing: -0.02em;
    font-weight: 900;
    line-height: 1.2;
}

.text-red { color: var(--vs-red-primary) !important; }
.text-muted { color: var(--vs-text-muted) !important; }
.text-mono { font-family: var(--vs-font-mono); }

/* Common Buttons */
.vs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--vs-radius-md);
    font-family: var(--vs-font-body);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    text-decoration: none;
}

.vs-btn-primary {
    background: linear-gradient(135deg, var(--vs-red-hover), var(--vs-red-primary));
    color: var(--vs-text-primary);
    box-shadow: 0 4px 15px rgba(227, 6, 19, 0.4);
}

.vs-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff3340, var(--vs-red-hover));
    box-shadow: 0 6px 20px rgba(227, 6, 19, 0.6);
    transform: translateY(-1px);
}

.vs-btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

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

.vs-btn-secondary:hover:not(:disabled) {
    background: #303030;
    border-color: var(--vs-border-active);
}

.vs-btn-danger {
    background: rgba(227, 6, 19, 0.2);
    color: #ff6b75;
    border: 1px solid rgba(227, 6, 19, 0.4);
}

.vs-btn-danger:hover:not(:disabled) {
    background: var(--vs-red-primary);
    color: #ffffff;
}

.vs-btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

.vs-btn-obs-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(227, 6, 19, 0.15);
    border: 1px solid rgba(227, 6, 19, 0.45);
    color: #ff5560;
    padding: 6px 12px;
    border-radius: var(--vs-radius-pill);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.vs-btn-obs-pill:hover {
    background: var(--vs-red-primary);
    color: #ffffff;
    border-color: var(--vs-red-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(227, 6, 19, 0.35);
}

.vs-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

/* Status Badges */
.vs-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--vs-radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.vs-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.vs-badge-live {
    background: rgba(227, 6, 19, 0.15);
    color: #ff4d58;
    border: 1px solid rgba(227, 6, 19, 0.35);
}
.vs-badge-live .vs-badge-dot {
    background: var(--vs-red-primary);
    box-shadow: 0 0 8px var(--vs-red-primary);
    animation: vsPulse 1.5s infinite;
}

.vs-badge-online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.vs-badge-online .vs-badge-dot {
    background: var(--vs-tally-prev);
    box-shadow: 0 0 8px var(--vs-tally-prev);
}

.vs-badge-connecting {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}
.vs-badge-connecting .vs-badge-dot {
    background: var(--vs-warning);
    animation: vsPulse 1s infinite;
}

.vs-badge-offline {
    background: rgba(142, 142, 147, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(142, 142, 147, 0.3);
}
.vs-badge-offline .vs-badge-dot {
    background: var(--vs-text-muted);
}

@keyframes vsPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* Audio VU Meter Level Bar */
.vs-vu-meter {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 14px;
    padding: 2px 4px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: var(--vs-radius-sm);
    border: 1px solid var(--vs-border-subtle);
}

.vs-vu-bar {
    width: 3px;
    height: 100%;
    background: #333333;
    border-radius: 1px;
    transition: height 0.08s ease, background-color 0.1s;
}

.vs-vu-bar.active-green { background: #10B981; }
.vs-vu-bar.active-yellow { background: #F59E0B; }
.vs-vu-bar.active-red { background: #E30613; }

/* Custom Form Elements */
.vs-input, .vs-select {
    width: 100%;
    background: var(--vs-bg-surface-2);
    border: 1px solid var(--vs-border-subtle);
    border-radius: var(--vs-radius-md);
    padding: 12px 14px;
    color: var(--vs-text-primary);
    font-family: var(--vs-font-body);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.vs-input:focus, .vs-select:focus {
    border-color: var(--vs-red-primary);
    box-shadow: 0 0 0 2px var(--vs-red-glow);
}

/* Modal Overlay */
.vs-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.vs-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.vs-modal-card {
    background: var(--vs-bg-surface-1);
    border: 1px solid var(--vs-border-subtle);
    border-radius: var(--vs-radius-lg);
    box-shadow: var(--vs-shadow-md);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.vs-modal-backdrop.active .vs-modal-card {
    transform: translateY(0);
}
