/**
 * Shared Tool Components CSS
 * Common styles for timers, games, and other interactive tools
 * 
 * This file contains shared styles that are used across multiple tools:
 * - Icon buttons (settings, fullscreen)
 * - Settings modal
 * - Top controls positioning
 */

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

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

/* ============================================
   ICON BUTTON
   ============================================ */

.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);
}

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

.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
   ============================================ */

.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;
}

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

/* ============================================
   SETTING ROW
   ============================================ */

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

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

.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);
}

.setting-select {
    width: 120px;
    padding: 0.625rem 0.75rem;
    padding-right: 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

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

/* ============================================
   APPLY BUTTON
   ============================================ */

.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);
}

/* ============================================
   FULLSCREEN STATES
   ============================================ */

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

/* ============================================
   PERSISTENCE NOTE
   ============================================ */

.persistence-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin: 1.5rem auto;
    padding: 0.875rem 1.25rem;
    max-width: 480px;
    border-radius: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
}

.persistence-note i {
    flex-shrink: 0;
    color: var(--primary-color, #3b82f6);
    font-size: 1rem;
}

.persistence-note a {
    color: var(--primary-color, #3b82f6);
    text-decoration: underline;
    font-weight: 600;
}

.persistence-note a:hover {
    opacity: 0.8;
}
