/**
 * Debate Timer Styles
 * Support for multiple speakers with individual time tracking
 */

/* ============================================
   DEBATE TIMER DEMO
   ============================================ */

.debate-timer-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    padding-top: 4.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    width: 100%;
    max-width: 900px;
    position: relative;
}

.debate-timer-demo.fullscreen {
    position: fixed;
    inset: 0;
    max-width: none;
    border-radius: 0;
    z-index: 9999;
    padding: 2rem;
    padding-top: 5rem;
    justify-content: center;
}

.debate-timer-demo.fullscreen .speakers-display {
    max-width: 900px;
}

.debate-timer-demo.fullscreen .speaker-time {
    font-size: 4rem;
}

/* ============================================
   TOP CONTROLS
   ============================================ */

.timer-top-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

/* ============================================
   TIMER TITLE SECTION
   ============================================ */

.timer-title-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    max-width: 400px;
}

.timer-title-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.timer-title-input:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.timer-title-input:focus {
    outline: none;
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.timer-title-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 500;
}

.timer-type-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

/* ============================================
   SETTINGS MODAL
   ============================================ */

.settings-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.settings-modal-overlay.open {
    display: flex;
}

.settings-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    width: 100%;
    max-width: 360px;
    overflow: hidden;
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.settings-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.setting-label {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.setting-input {
    width: 80px;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.settings-modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.apply-settings-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-settings-btn:hover {
    filter: brightness(1.1);
}

/* ============================================
   SPEAKER COLORS
   ============================================ */

:root {
    --speaker-1: #3b82f6;
    --speaker-2: #8b5cf6;
    --speaker-3: #10b981;
    --speaker-4: #f59e0b;
    --speaker-5: #ef4444;
    --speaker-6: #ec4899;
    --speaker-7: #06b6d4;
    --speaker-8: #84cc16;
}

/* ============================================
   SPEAKERS DISPLAY GRID
   ============================================ */

.speakers-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-height: none;
    overflow: visible;
}

.speakers-display.speakers-3 {
    grid-template-columns: repeat(3, 1fr);
}

.speakers-display.speakers-4,
.speakers-display.speakers-5,
.speakers-display.speakers-6,
.speakers-display.speakers-7,
.speakers-display.speakers-8 {
    grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   SPEAKER CARD
   ============================================ */

.speaker-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 0.5rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 0;
}

.speaker-card:hover {
    background: var(--bg-hover);
}

.speaker-card.active {
    border-color: var(--speaker-color, var(--primary-color));
    background: rgba(var(--speaker-rgb, var(--primary-rgb)), 0.1);
}

.speaker-card.expired .speaker-time {
    color: #ef4444;
}

.speaker-name-input {
    width: 100%;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-tertiary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.speaker-name-input:hover {
    background: var(--bg-hover);
    border-color: var(--border-color);
}

.speaker-name-input:focus {
    outline: none;
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.speaker-time {
    font-size: 1.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    line-height: 1;
}

.speaker-progress {
    width: 100%;
    height: 4px;
    background: var(--bg-hover);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--speaker-color, var(--primary-color));
    transition: width 0.5s linear;
}

/* ============================================
   TIMER CONTROLS
   ============================================ */

.timer-controls {
    display: none;
}

.bottom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.pause-btn {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pause-btn:hover:not(:disabled) {
    color: var(--text-primary);
    background: var(--bg-hover);
}

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

.reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.add-speaker-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary-color);
    background: transparent;
    border: 2px dashed var(--primary-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-speaker-btn:hover {
    color: white;
    background: var(--primary-color);
    border-style: solid;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .speakers-display.speakers-3,
    .speakers-display.speakers-4,
    .speakers-display.speakers-5,
    .speakers-display.speakers-6,
    .speakers-display.speakers-7,
    .speakers-display.speakers-8 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .debate-timer-demo {
        padding: 1.5rem 1rem;
        padding-top: 4rem;
    }

    .speaker-time {
        font-size: 1.25rem;
    }

    .speaker-name-input {
        font-size: 0.7rem;
    }

    .debate-timer-demo.fullscreen .speaker-time {
        font-size: 2rem;
    }

    .bottom-controls {
        flex-wrap: wrap;
    }

    .add-speaker-btn {
        width: 100%;
        order: 3;
    }

    .speakers-display,
    .speakers-display.speakers-3,
    .speakers-display.speakers-4,
    .speakers-display.speakers-5,
    .speakers-display.speakers-6,
    .speakers-display.speakers-7,
    .speakers-display.speakers-8 {
        grid-template-columns: repeat(2, 1fr);
    }
}
