/**
 * html5RemoteControl - Styles
 * Version: 1.0.0
 * Date: October 24, 2025
 * Author: Doug Hesseltine
 * Copyright: Technologist.services 2025
 */

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --secondary-hover: #475569;
    --success: #16a34a;
    --success-hover: #15803d;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --warning: #f59e0b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Header ===== */
header {
    background: var(--bg-white);
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ===== Main Container ===== */
main.container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ===== Panels ===== */
.panel {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.panel h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.help-text {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-hover);
}

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

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
}

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

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
}

/* ===== Code Display ===== */
.code-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: var(--radius);
    border: 2px solid var(--border);
}

.code-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--primary);
    user-select: all;
}

.code-instructions {
    text-align: center;
    margin: 1rem 0;
}

.code-instructions p {
    margin-bottom: 0.5rem;
}

.expires {
    font-weight: 600;
    color: var(--warning);
}

/* ===== Input Group ===== */
.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== Status Boxes ===== */
.status-box {
    padding: 1.5rem;
    border-radius: var(--radius);
    margin: 2rem 0;
    text-align: center;
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.status-message {
    font-size: 1.1rem;
    font-weight: 600;
}

.status-success {
    background: #dcfce7;
    color: var(--success);
    border: 2px solid var(--success);
}

.status-warning {
    background: #fef3c7;
    color: #d97706;
    border: 2px solid var(--warning);
}

.status-error {
    background: #fee2e2;
    color: var(--danger);
    border: 2px solid var(--danger);
}

/* ===== Connection Status ===== */
.connection-status {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius);
    text-align: center;
    margin: 1rem 0;
    font-weight: 500;
    color: var(--text-muted);
}

/* ===== Video Container ===== */
.video-container {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin: 1rem 0;
    position: relative;
    box-shadow: var(--shadow-lg);
}

video {
    width: 100%;
    height: auto;
    display: block;
    min-height: 300px;
    object-fit: contain;
}

/* ===== Viewer Controls ===== */
.viewer-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.viewer-controls .btn {
    flex: 1;
}

/* ===== Utility Classes ===== */
/* Viewer cursor pointer overlay (on sharer screen) */
.cursor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
}
.cursor-overlay .cursor-circle {
    position: absolute;
    width: 40px;
    height: 40px;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(34, 197, 94, 0.9);
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
    transition: left 0.05s ease-out, top 0.05s ease-out;
}

.hidden {
    display: none !important;
}

/* ===== Status Ticker ===== */
.status-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    z-index: 1000;
    border-top: 2px solid #667eea;
    backdrop-filter: blur(10px);
}

.ticker-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#tickerStatus {
    font-size: 0.6rem;
    animation: pulse 2s infinite;
}

#tickerStatus.status-connected {
    color: #16a34a;
}

#tickerStatus.status-connecting {
    color: #f59e0b;
}

#tickerStatus.status-error {
    color: #dc2626;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== Footer ===== */
footer {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    margin-bottom: 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    main.container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .code {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .panel {
        padding: 1.5rem;
    }
    
    .code {
        font-size: 2rem;
        letter-spacing: 0.2em;
    }
    
    input[type="text"] {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    main.container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .panel {
        padding: 1rem;
    }
    
    .code-display {
        padding: 1rem;
    }
    
    .code {
        font-size: 1.5rem;
    }
    
    .input-group {
        flex-direction: column;
    }
}
