/**
 * CWRUXR Anatomy Teacher - Web Interface Styles
 * Modern, clean, mobile-responsive design
 */

/* CSS Variables for theming */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;
        --card-background: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-color: #334155;
    }
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 0;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Status Bar */
.status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.status-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-value {
    font-size: 1rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.status-value.connected {
    background: #d1fae5;
    color: #065f46;
}

.status-value.disconnected {
    background: #fee2e2;
    color: #991b1b;
}

.status-value.active {
    background: #dbeafe;
    color: #1e40af;
}

.status-value.inactive {
    background: #f1f5f9;
    color: #475569;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Card */
.card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.card ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.card li {
    margin-bottom: 8px;
}

.note {
    padding: 15px;
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    border-radius: 6px;
    margin-top: 15px;
    color: #78350f;
}

/* Buttons */
.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.btn {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

/* Messages / Console */
.messages {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.message {
    padding: 4px 0;
    color: var(--text-secondary);
}

/* Visualizer */
.visualizer {
    background: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

#audio-canvas {
    width: 100%;
    height: 100px;
    border-radius: 8px;
}

/* Error Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-background);
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-content h2 {
    margin-bottom: 15px;
    color: var(--error-color);
}

.modal-content p {
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.version {
    margin-top: 10px;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .status-bar {
        flex-direction: column;
        gap: 15px;
    }

    .button-container {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .card {
        padding: 20px;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-value.active {
    animation: pulse 2s ease-in-out infinite;
}

/* Scrollbar styling */
.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: #475569;
}
