:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #333333;
    --text-secondary: #4a4a4a;
    --accent: #0056b3;
    --border: #ddd;
    --shadow: rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #4a9eff;
    --border: #444;
    --shadow: rgba(0,0,0,0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

#app {
    min-height: 100vh;
}

.settings-panel {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2rem;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    flex: 1;
    padding: 15px;
    font-size: 1.1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
}

.settings-tab {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.settings-tab:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .settings-tab:hover {
    background: rgba(255,255,255,0.1);
}

.settings-tab.active {
    background: var(--accent);
    color: white;
}

/* Tab Content */
.tab-content {
    position: relative;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.settings-group {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.settings-group h2 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.setting-row label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-inputs {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-input-group label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.time-input-group input {
    width: 90px;
    padding: 12px;
    font-size: 1.6rem;
    font-weight: 600;
    text-align: center;
    border: 3px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    min-height: 50px;
}

.time-input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
    transform: scale(1.05);
}

select, input[type="time"], input[type="date"], input[type="text"] {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 44px;
}

select:focus, input[type="time"]:focus, input[type="date"]:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

select:hover, input[type="time"]:hover, input[type="date"]:hover, input[type="text"]:hover {
    border-color: var(--accent);
}

/* Dark theme improvements */
[data-theme="dark"] .time-input-group input {
    background: var(--bg-secondary);
    border-color: #555;
}

[data-theme="dark"] .time-input-group input:focus {
    background: var(--bg-primary);
    border-color: var(--accent);
}

[data-theme="dark"] select, 
[data-theme="dark"] input[type="time"], 
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="text"] {
    background: var(--bg-secondary);
    border-color: #555;
    color: var(--text-primary);
}

[data-theme="dark"] select:focus,
[data-theme="dark"] input[type="time"]:focus,
[data-theme="dark"] input[type="date"]:focus,
[data-theme="dark"] input[type="text"]:focus {
    background: var(--bg-primary);
    border-color: var(--accent);
}

[data-theme="dark"] input::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Make date/weekday checkboxes smaller */
#show-date, #show-weekday {
    transform: scale(0.8);
    margin-right: 8px;
}

/* Adjust labels for smaller checkboxes */
label:has(#show-date), label:has(#show-weekday) {
    font-size: 0.95rem;
    align-items: center;
    display: flex;
}

.speed-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.speed-btn {
    padding: 12px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.speed-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.speed-btn small {
    display: block;
    font-size: 0.75rem;
    margin-top: 4px;
    opacity: 0.8;
}

.speed-explanation {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.speed-explanation .explanation-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
}

.theme-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.theme-btn {
    padding: 15px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.theme-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.theme-preview {
    font-size: 1.5rem;
    font-weight: bold;
}

.preset-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.preset-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.preset-btn.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.preset-actions {
    display: flex;
    gap: 10px;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--accent);
    color: white;
    width: 100%;
    font-size: 1.2rem;
    padding: 15px;
    margin-top: 20px;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-primary);
}

.display-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Fullskärmsläge - endast två färger */
.display-panel .timer-display,
.display-panel .clock-display {
    color: var(--text-primary);
}

.display-panel .clock-date {
    color: var(--text-primary);
}

.display-content {
    text-align: center;
}

.timer-display, .clock-display {
    font-size: clamp(6rem, 20vw, 25rem);
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', monospace;
    text-align: center;
    line-height: 1;
    max-width: 90vw;
    word-break: break-all;
}

.timer-display.blinking {
    animation: blink 0.5s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.clock-date {
    font-size: clamp(1.5rem, 5vw, 3rem);
    margin-top: 20px;
    color: var(--text-secondary);
}

.analog-clock {
    width: min(80vw, 80vh);
    height: min(80vw, 80vh);
}

.pause-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10rem;
    opacity: 0.5;
    pointer-events: none;
}

.help-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.help-indicator:hover {
    opacity: 1;
}

.help-tooltip {
    position: absolute;
    bottom: 70px;
    right: 20px;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--shadow);
    min-width: 250px;
}

.help-tooltip kbd {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border);
    font-family: monospace;
}

.hidden {
    display: none !important;
}

/* Live Preview */
.live-preview {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
    border: 1px solid var(--border);
}

.preview-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 500;
}

.preview-display {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.preview-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.preview-time {
    font-size: 2.5rem;
    font-weight: 300;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    line-height: 1;
}

.preview-date {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 5px;
    text-align: center;
}

.preview-analog {
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.preview-clock-face {
    width: 100%;
    height: 100%;
}

/* Theme-specific preview styles */
.preview-theme-digital-retro .preview-time {
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0,255,0,0.5);
    background: #1a1a1a;
    padding: 15px 25px;
    border-radius: 8px;
}

.preview-theme-tactical .preview-time {
    color: #ff6600;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    background: #2a2a2a;
    padding: 15px 25px;
    border-radius: 8px;
}

.preview-theme-nixie .preview-time {
    background: linear-gradient(180deg, #1a0a0a 0%, #2a1515 100%);
    color: #ff9955;
    padding: 20px 30px;
    border-radius: 12px;
    text-shadow: 
        0 0 20px rgba(255,150,85,0.8),
        0 0 40px rgba(255,150,85,0.6);
    box-shadow: 
        inset 0 0 30px rgba(255,150,85,0.2),
        0 0 20px rgba(255,150,85,0.1);
}

.preview-theme-lcd .preview-time {
    background: linear-gradient(135deg, #9eb89e 0%, #8aa68a 100%);
    color: #1a2a1a;
    padding: 15px 25px;
    border-radius: 8px;
    position: relative;
    border: 2px inset #9eb89e;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 700;
    letter-spacing: 2px;
    z-index: 1;
}

.preview-theme-lcd .preview-time::before {
    content: '88:88';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    opacity: 0.15;
    z-index: 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
}

/* Split-flap/Flip Clock Theme */
.preview-theme-split-flap .preview-time {
    background: linear-gradient(180deg, #2c2c2c 0%, #1a1a1a 50%, #2c2c2c 100%);
    color: #ffffff;
    border: 2px solid #444;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 0.1em;
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.1),
        inset 0 -1px 0 rgba(0,0,0,0.3),
        0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.preview-theme-split-flap .preview-time::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #666 20%, #666 80%, transparent 100%);
    transform: translateY(-50%);
    z-index: 1;
}

.preview-theme-split-flap .preview-time::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(255,255,255,0.05) 0%, 
        transparent 25%, 
        transparent 75%, 
        rgba(0,0,0,0.1) 100%);
    pointer-events: none;
}

[data-theme="dark"] .preview-theme-split-flap .preview-time {
    background: linear-gradient(180deg, #3c3c3c 0%, #2a2a2a 50%, #3c3c3c 100%);
    color: #f0f0f0;
    border-color: #555;
}

.preview-theme-led-segment .preview-time {
    background: #000000;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    padding: 20px 30px;
    border-radius: 8px;
    border: 1px solid #333;
    text-shadow: 
        0 0 5px #ff0000,
        0 0 10px #ff0000,
        0 0 15px #ff0000;
    position: relative;
    letter-spacing: 0.2em;
    font-size: 1.2em;
}

.preview-theme-led-segment .preview-time::before {
    content: '88:88';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #330000;
    opacity: 0.3;
    z-index: 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-shadow: none;
}

.preview-theme-led-segment .preview-time > * {
    position: relative;
    z-index: 1;
}

/* Preview Flip Clock */
.preview-flip-clock {
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-flip-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-flip-digit {
    width: 35px;
    height: 45px;
    background: linear-gradient(180deg, #333 0%, #222 50%, #111 100%);
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1rem;
    position: relative;
}

.preview-flip-digit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%);
}

.preview-flip-separator {
    color: var(--text-primary);
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 5px;
}

[data-theme="dark"] .preview-flip-digit {
    background: linear-gradient(180deg, #444 0%, #333 50%, #222 100%);
    border-color: #555;
}

/* Preview 7-Segment */
.preview-7segment {
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-segment-display {
    background: #000000;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.4rem;
    padding: 15px 25px;
    border-radius: 6px;
    border: 1px solid #333;
    text-shadow: 
        0 0 5px #ff0000,
        0 0 10px #ff0000,
        0 0 15px #ff0000;
    letter-spacing: 0.1em;
    position: relative;
}

.preview-segment-display::before {
    content: '88:88:88';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #330000;
    opacity: 0.3;
    text-shadow: none;
}

/* Flip Clock Styles */
.flip-clock {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.flip-clock-container {
    text-align: center;
}

.flip-clock-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.flip-clock-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.flip-clock-separator {
    font-size: 8rem;
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1;
    margin: 0 20px;
}

.flip-clock-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* Flip digit container */
.flip-digit {
    display: flex;
    gap: 5px;
}

/* Custom flip styling */
.tick {
    width: 120px !important;
    height: 160px !important;
    font-size: 5rem !important;
    font-weight: bold !important;
    font-family: 'Courier New', monospace !important;
    position: relative;
    perspective: 800px;
}

.tick-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.tick-card.flipping {
    transform: rotateX(-90deg);
}

.tick-face {
    width: 100%;
    height: 100%;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #333 0%, #222 50%, #111 100%);
    color: white;
    border: 2px solid #444;
    border-radius: 8px;
    box-shadow: 
        0 3px 6px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
    backface-visibility: hidden;
}

.tick-face::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.2) 20%, 
        rgba(255,255,255,0.2) 80%, 
        transparent 100%);
    transform: translateY(-50%);
}

.tick-face.front {
    transform: rotateX(0deg);
}

.tick-face.back {
    transform: rotateX(90deg);
}

[data-theme="dark"] .tick-face {
    background: linear-gradient(180deg, #444 0%, #333 50%, #222 100%);
    border-color: #555;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .flip-clock-time {
        gap: 10px;
    }
    
    .flip-clock-separator {
        font-size: 2.5rem;
        margin: 0 5px;
    }
    
    .tick {
        width: 45px !important;
        height: 60px !important;
        font-size: 1.8rem !important;
    }
}

/* Download section - outside preview */
.download-section {
    margin-top: 20px;
    text-align: center;
}

.download-offline-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.download-offline-btn:hover {
    background: color-mix(in srgb, var(--accent) 90%, black);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.download-offline-btn:active {
    transform: translateY(0);
}

.download-info {
    margin-top: 8px;
    opacity: 0.7;
    font-size: 0.85rem;
}

.github-link {
    margin-top: 15px;
    text-align: center;
}

.github-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

.github-link a:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px var(--shadow);
}

.github-icon {
    font-size: 1rem;
}

/* New Features Styles */

/* Exercise Title */
.exercise-title-display {
    text-align: center;
    padding: 0 20px 20px 20px;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    opacity: 0.9;
}

/* Preparation Phase */
.prep-phase-display {
    text-align: center;
    padding: 40px 20px;
}

.prep-message {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.prep-time {
    font-size: 4rem;
    font-weight: 300;
    font-family: 'Courier New', monospace;
    color: var(--accent);
}

.prep-settings {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
}

/* Progress Displays */
.progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.1);
    z-index: 100;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-circle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    z-index: 100;
}

.progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

/* Enhanced Pause Indicator */
.pause-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 200;
    width: 90vw;
    max-width: 1200px;
}

.pause-symbol {
    font-size: 8rem;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

.pause-message {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 40px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

/* Blur effect for display when paused */
.display.paused {
    filter: blur(5px);
    opacity: 0.6;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

/* Visual Signals */
.visual-signal-green {
    background: linear-gradient(45deg, #4caf50, #66bb6a) !important;
    transition: background 2s ease;
}

.visual-signal-yellow {
    background: linear-gradient(45deg, #ff9800, #ffb74d) !important;
    transition: background 2s ease;
}

.visual-signal-red {
    background: linear-gradient(45deg, #f44336, #ef5350) !important;
    transition: background 2s ease;
}

.pulse-animation {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .settings-tabs {
        gap: 2px;
        padding: 2px;
    }
    
    .settings-tab {
        padding: 6px 8px;
        font-size: 11px;
        min-width: 80px;
    }
    
    .speed-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .theme-selector {
        grid-template-columns: 1fr;
    }
    
    .time-inputs {
        flex-direction: column;
    }
    
    .time-input-group input {
        width: 120px;
    }
    
    .prep-message {
        font-size: 1.4rem;
    }
    
    .prep-time {
        font-size: 3rem;
    }
    
    .exercise-title-display {
        font-size: 1.5rem;
        padding: 0 15px 15px 15px;
    }
    
    .pause-symbol {
        font-size: 5rem;
    }
    
    .pause-message {
        font-size: 2rem;
        padding: 15px 25px;
    }
}

/* Display Size Scaling */
#display-content {
    transition: transform 0.3s ease;
    will-change: transform;
}

#display-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: padding 0.3s ease;
}

/* Ensure split-flap and LED segment themes scale nicely */
.flip-clock,
.segment-display {
    transform-origin: center center;
}

/* Mobile responsive adjustments */
@media screen and (max-width: 768px) {
    #display-content {
        min-width: 300px;
        padding: 10px;
    }
    
    /* Prevent timer/clock text from wrapping */
    .timer-display,
    .clock-display {
        white-space: nowrap;
        font-size: clamp(2rem, 8vw, 4rem);
    }
    
    #timer-time,
    #clock-time {
        font-size: clamp(2rem, 8vw, 4rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Adjust exercise title for mobile */
    .exercise-title-display {
        font-size: 1.2rem !important;
        padding: 0 10px 10px 10px !important;
    }
    
    /* Adjust pause indicator for mobile */
    .pause-symbol {
        font-size: 4rem !important;
    }
    
    .pause-message {
        font-size: 1.5rem !important;
        padding: 10px 15px !important;
    }
    
    /* Theme-specific mobile adjustments */
    .preview-theme-digital-retro .preview-time,
    .preview-theme-tactical .preview-time,
    .preview-theme-nixie .preview-time,
    .preview-theme-lcd .preview-time {
        font-size: clamp(1.5rem, 6vw, 2.5rem) !important;
        padding: 10px 15px !important;
        white-space: nowrap;
    }
    
    /* Analog clock mobile adjustment */
    .preview-analog svg {
        max-width: 90vw;
        max-height: 90vw;
    }
}