:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.6);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.1);
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --font-family: 'Inter', sans-serif;
    --speaker-bg: rgba(255, 255, 255, 0.03);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --neon-text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(59, 130, 246, 0.3);
}

[data-theme="light"] {
    --bg-color: #fdfbf7;
    /* Cream */
    --card-bg: rgba(255, 255, 255, 0.65);
    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --input-bg: rgba(255, 255, 255, 0.8);
    --input-border: rgba(0, 0, 0, 0.1);
    --speaker-bg: rgba(0, 0, 0, 0.03);
    --glass-border: 1px solid rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --neon-text-shadow: none;
    --accent-glow: rgba(59, 130, 246, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    transition: background-color 0.5s ease;
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.3) 0px, transparent 60%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.25) 0px, transparent 60%);
    background-attachment: fixed;
}

.container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

header h1 {
    text-align: left;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-secondary);
    margin: 0;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--text-primary);
}

/* Hide/Show icons based on theme */
.icon-sun {
    display: block;
}

.icon-moon {
    display: none;
}

[data-theme="light"] .icon-sun {
    display: none;
}

[data-theme="light"] .icon-moon {
    display: block;
}

.panel {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hidden {
    display: none;
}

.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: var(--font-family);
    transition: all 0.2s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-family);
    position: relative;
    overflow: hidden;
}

.btn.primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn.primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn.secondary {
    background-color: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
}

.btn.secondary:hover {
    background-color: rgba(128, 128, 128, 0.1);
    transform: translateY(-1px);
}

.btn.text-only {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.btn.text-only:hover {
    color: var(--text-primary);
    text-decoration: none;
    opacity: 1;
}

.timer-display {
    font-variant-numeric: tabular-nums;
    text-align: center;
    font-weight: 700;
    text-shadow: var(--neon-text-shadow);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.large {
    font-size: 5rem;
    line-height: 1;
    margin: 1rem 0;
}

.medium {
    font-size: 3.5rem;
    line-height: 1;
    margin: 0.5rem 0;
}

.main-timer-container {
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid #333;
    padding-bottom: 2rem;
}

.main-timer-container h2 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.speaker-timer-container {
    text-align: center;
    padding: 1.5rem;
    border-radius: 16px;
    background-color: var(--speaker-bg);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.speaker-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Timer States */
.state-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.state-warning .medium {
    color: var(--warning-color);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.state-overtime {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    animation: pulse 2s infinite;
}

.state-overtime .medium {
    color: var(--danger-color);
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--success-color);
    width: 0%;
    transition: width 1s linear, background-color 0.3s ease;
    box-shadow: 0 0 10px var(--success-color);
}

.state-warning .progress-bar {
    background-color: var(--warning-color);
    box-shadow: 0 0 10px var(--warning-color);
}

.state-overtime .progress-bar {
    background-color: var(--danger-color);
    width: 100% !important;
    box-shadow: 0 0 10px var(--danger-color);
}

#next-speaker-btn {
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    color: white;
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow);
}

#next-speaker-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

[data-theme="light"] #next-speaker-btn {
    background: linear-gradient(135deg, #2dd4bf, #0ea5e9);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

[data-theme="light"] #next-speaker-btn:hover {
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
}

footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

footer a {
    color: var(--text-secondary);
    text-decoration: underline;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--accent-color);
}