/* Shared styles for both host and client pages */

:root {
    /* Light theme colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    /* Brand colors */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --info: #06b6d4;

    /* Status colors */
    --status-connected: #10b981;
    --status-disconnected: #6b7280;
    --status-error: #ef4444;
    --status-warning: #f59e0b;
}

[data-theme="dark"] {
    /* Dark theme colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 30px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.header-left h1 {
    color: var(--text-primary);
    margin-bottom: 5px;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--status-disconnected);
    transition: background-color 0.3s ease;
}

.status-badge.connected .status-dot {
    background: var(--status-connected);
    animation: pulse-dot 2s infinite;
}

.status-badge.error .status-dot {
    background: var(--status-error);
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.card-title {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    font-family: inherit;
}

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

.btn:active:not(:disabled) {
    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-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);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.btn-large {
    padding: 14px 24px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn .icon {
    font-size: 1.2rem;
}

/* Icons */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Live Indicator */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--danger);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.pulse {
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Transcript Content */
.transcript-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    max-height: 600px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    transition: font-size 0.2s ease;
}

.transcript-content.font-small {
    font-size: 0.9rem;
}

.transcript-content.font-medium {
    font-size: 1.1rem;
}

.transcript-content.font-large {
    font-size: 1.4rem;
}

.transcript-content.font-xlarge {
    font-size: 1.7rem;
}

.transcript-line {
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.transcript-line.partial {
    color: var(--text-secondary);
    font-style: italic;
    border-left-color: var(--warning);
}

.transcript-line.final {
    color: var(--text-primary);
    border-left-color: var(--success);
}

.placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.placeholder .icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.placeholder p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.placeholder small {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}

.empty-state .icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* Scrollbar Styling */
.transcript-content::-webkit-scrollbar {
    width: 8px;
}

.transcript-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

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

.transcript-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.info {
    border-left-color: var(--info);
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.toast-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
}

.toast-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.toast-close:active {
    transform: scale(0.95);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }

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

    h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 15px 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 16px;
    }

    .btn-large {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: none;
    }

    .toast {
        padding: 12px 14px;
        gap: 10px;
    }

    .toast-icon {
        font-size: 1.3rem;
    }

    .toast-title {
        font-size: 0.9rem;
    }

    .toast-message {
        font-size: 0.85rem;
    }

    .toast-close {
        font-size: 1.1rem;
        min-width: 32px;
        min-height: 32px;
        padding: 6px;
    }
}
