/* Smartboard Receiver Styles */

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

:root {
    --primary-color: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, #1e293b 100%);
    color: var(--text-color);
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Main content */
main {
    background: var(--surface-color);
    border-radius: 1.5rem;
    padding: 3rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Status bar */
.status-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 1rem;
    border: 2px solid var(--border-color);
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.status-value.waiting {
    color: var(--warning-color);
}

.status-value.connected {
    color: var(--success-color);
}

.status-value.error {
    color: var(--error-color);
}

.status-value.navigating {
    color: var(--primary-color);
}

/* QR Container */
.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 450px;
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.qr-container canvas {
    image-rendering: pixelated;
    border-radius: 0.5rem;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
}

.error {
    text-align: center;
    color: var(--error-color);
}

.error p {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.error-detail {
    font-size: 0.875rem !important;
    color: var(--text-secondary) !important;
    font-family: monospace;
}

/* Spinner */
.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Instructions */
.instructions {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
}

.instructions h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.instructions ol {
    padding-left: 1.5rem;
}

.instructions li {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.instructions strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Actions */
.actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

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

/* Navigate Overlay */
.navigate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

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

.navigate-message {
    text-align: center;
    color: white;
}

.navigate-message h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.navigate-message p {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.url-preview {
    font-size: 1rem !important;
    color: var(--text-secondary) !important;
    font-family: monospace;
    word-break: break-all;
    max-width: 800px;
    margin: 1rem auto 0;
}

/* Log container */
.log-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 1rem;
    border: 2px solid var(--border-color);
}

.log-container h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.log {
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.log-entry {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
}

.log-time {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.log-info {
    color: var(--text-color);
}

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

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    main {
        padding: 1.5rem;
    }
    
    .status-bar {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .qr-container {
        min-height: 350px;
        padding: 1rem;
    }
    
    .instructions li {
        font-size: 1rem;
    }
    
    .btn {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
}

/* Scrollbar styling */
.log::-webkit-scrollbar {
    width: 8px;
}

.log::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.log::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.log::-webkit-scrollbar-thumb:hover {
    background: #475569;
}
