/* CSS Variables & Themes */
:root {
    --primary: rgb(162, 76, 255);
    --primary-border: rgb(0, 0, 0);
    --secondary: rgb(255, 125, 0);
    --akzent: rgb(255, 200, 0);

    /* --- Bootstrap-Blau mit Ihrem Lila überschreiben --- */
    --bs-primary: var(--primary);
    --bs-primary-rgb: 162, 76, 255;
    /* --------------------------------------------------------- */
}

/* Snowflake Container Override - begrenzt auf Viewport */
#snowflake-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    pointer-events: none !important;
    z-index: 9999 !important;
}

/* Schneeflocken abschneiden wenn sie den Viewport verlassen */
.snowflake {
    clip-path: inset(0 0 0 0);
}

html {
    height: 100%;
    height: 100svh;
    overflow: hidden;
}

body {
    margin: 0;
    padding: 0;
    height: 100%;
    height: 100svh;
    font-family: 'Montserrat', sans-serif;
    color: #b2b2b2;
    transition: background-image 0.5s ease, background-color 0.5s ease, color 0.5s ease;
    /* Für Hintergrundbild-Positionierung */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

/* Overlay für Hintergrundbild */
body.bg-image-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Dunkles Overlay für Lesbarkeit */
    z-index: -1;
    /* Hinter den Inhalt */
}

main {
    margin: 0 !important;
    padding: 0 1rem !important;
    height: 100%;
    height: 100svh;
    width: 100% !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
    box-sizing: border-box;
    padding-bottom: 120px !important;
    /* Platz für UI-Buttons */
}

/* Base styles for the sub-text */
main p {
    transition: color 0.5s ease, opacity 0.5s ease;
    max-width: 800px;
}

/* Klasse zum Ausblenden des Untertitels */
body.subtitle-hidden main p {
    display: none !important;
}

main p.subtitle-text {
    display: block;
}

/*
--- Absolute Positioning ---
*/
#timerBox {
    --timer-size: clamp(3rem, 20vw, 30rem);
    font-weight: bold;
    font-size: var(--timer-size);
    padding: 1rem;
    transition: font-family 0.5s ease, color 0.5s ease, text-shadow 0.5s ease, font-size 0.5s ease;
    width: 100%;
    position: relative;
    text-align: center;
    line-height: 1;
    min-height: 1.2em;
}

#timerBox>span {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
}

#timerBox>.timer-colon {
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

#timerBox>.timer-min {
    right: 50%;
    margin-right: 0.2em;
    text-align: right;
}

#timerBox>.timer-sec {
    left: 50%;
    margin-left: 0.2em;
    text-align: left;
}

/* Weekend message styling - override the original positioning styles for spans */
#timerBox.weekend-text>span {
    display: none !important;
    /* Hide timer spans when showing weekend text */
}

#timerBox.weekend-text {
    font-size: clamp(1.8rem, 10vw, 6rem) !important;
    /* Reduced max size */
    text-align: center !important;
    width: 100% !important;
    height: 100% !important;
    /* Use full height */
    padding: 2rem !important;
    line-height: 1.4 !important;
    /* Increased for better readability */
    overflow: hidden !important;
    box-sizing: border-box !important;
    position: relative !important;
    /* Reset to relative positioning */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Specific styling for the weekend content div */
.weekend-content {
    width: 100% !important;
    text-align: center !important;
    word-break: break-word !important;
    /* Break long words to prevent overflow */
    padding: 1rem !important;
    font-weight: bold !important;
    /* Maintain bold weight */
    line-height: 1.2 !important;
}

/* Font Classes for #timerBox (Applied to everything inside) */
#timerBox.font-montserrat,
#timerBox.font-montserrat * {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700 !important;
}

#timerBox.font-orbitron {
    font-size: calc(var(--timer-size) * 0.85);
    /* Scale down Orbitron relative to CURRENT base size */
}

#timerBox.font-orbitron,
#timerBox.font-orbitron * {
    font-family: 'Orbitron', monospace !important;
    font-weight: 700 !important;
}

#timerBox.font-playfair,
#timerBox.font-playfair * {
    font-family: 'Playfair Display', serif !important;
    font-weight: 500 !important;
}

#timerBox.font-lato,
#timerBox.font-lato * {
    font-family: 'Lato', sans-serif !important;
    font-weight: 300 !important;
}

#timerBox.font-comfortaa,
#timerBox.font-comfortaa * {
    font-family: 'Comfortaa', cursive !important;
    font-weight: 500 !important;
}

#timerBox.font-righteous,
#timerBox.font-righteous * {
    font-family: 'Righteous', cursive !important;
    font-weight: 400 !important;
}

#timerBox.font-lora,
#timerBox.font-lora * {
    font-family: 'Lora', serif !important;
    font-weight: 500 !important;
}

#timerBox.font-comic-sans,
#timerBox.font-comic-sans * {
    font-family: 'Comic Sans MS', 'Comic Sans', cursive !important;
    font-weight: 400 !important;
}


/* Large Size Class */
#timerBox.large-size {
    --timer-size: clamp(4rem, 28vw, 40rem);
    min-height: 1.2em;
}

/* Global styles in shared/css/_components.css handle .form-check-input */

/* --- UI Buttons --- */
#settings-button,
#fullscreen-button,
#home-button,
#pip-button {
    position: fixed;
    bottom: 2rem;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 4rem;
    height: 4rem;
    z-index: 10000;
    /* Höher als Snow (9999) */
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    /* Deaktiviere alle Transform-Effekte die Flackern verursachen */
    transform: none !important;
}

#settings-button:hover,
#fullscreen-button:hover,
#home-button:hover,
#pip-button:hover {
    color: white;
    background: rgba(0, 0, 0, 0.6);
    transform: none !important;
}

/* Deaktiviere den Shine-Effekt auf diesen Buttons */
#settings-button::before,
#fullscreen-button::before,
#home-button::before,
#pip-button::before {
    display: none !important;
}

/* Linke Seite: Home unten, Settings darüber */
#home-button {
    left: 2rem;
    bottom: 2rem;
    text-decoration: none;
}

#settings-button {
    left: 2rem;
    bottom: 7rem;
}

/* Rechte Seite: Vollbild unten, PiP darüber */
#fullscreen-button {
    right: 2rem;
    bottom: 2rem;
}

#pip-button {
    right: 2rem;
    bottom: 7rem;
}

/* Hide buttons in fullscreen mode */
body.fullscreen-mode #settings-button,
body.fullscreen-mode #fullscreen-button,
body.fullscreen-mode #home-button,
body.fullscreen-mode #pip-button {
    display: none !important;
}

/* Deaktiviere Snow-Wrapper für newTimer UI-Buttons */
#settings-button.snow-wrapped,
#fullscreen-button.snow-wrapped,
#home-button.snow-wrapped,
#pip-button.snow-wrapped {
    transform: none !important;
}

/* Verstecke Snow-Cap auf diesen Buttons */
.snow-wrapper:has(#settings-button) .snow-cap,
.snow-wrapper:has(#fullscreen-button) .snow-cap,
.snow-wrapper:has(#home-button) .snow-cap,
.snow-wrapper:has(#pip-button) .snow-cap {
    display: none !important;
}

/* ===========================================
   INTRO POPUP (First Visit)
   =========================================== */

.intro-popup {
    position: fixed;
    bottom: 7rem;
    right: 2rem;
    z-index: 10001;
    max-width: 280px;
    animation: intro-popup-fade-in 0.5s ease-out;
}

.intro-popup-content {
    background: rgba(40, 40, 50, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    color: #fff;
}

.intro-popup-content h6 {
    margin: 0 0 0.5rem 0;
    color: var(--primary);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.intro-popup-content p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.intro-popup-content small {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Pfeil der auf den Button zeigt */
.intro-popup-arrow {
    position: absolute;
    bottom: -10px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(40, 40, 50, 0.95);
}

/* Animation */
@keyframes intro-popup-fade-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulsierender Highlight auf Settings-Button wenn Popup sichtbar */
.settings-highlight {
    animation: settings-pulse 1.5s infinite ease-in-out;
}

@keyframes settings-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(162, 76, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 20px 8px rgba(162, 76, 255, 0.6);
    }
}

/* ===========================================
   TUTORIAL SYSTEM (Multi-Step)
   =========================================== */

/* Overlay für das Tutorial */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    cursor: pointer;
}

/* Basis-Styles für Tutorial-Popups */
.tutorial-popup {
    position: fixed;
    z-index: 10001;
    max-width: 300px;
    animation: tutorial-fade-in 0.4s ease-out;
}

.tutorial-popup-content {
    background: rgba(40, 40, 50, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    color: #fff;
}

.tutorial-popup-content h6 {
    margin: 0 0 0.5rem 0;
    color: var(--primary);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tutorial-popup-content p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #fff;
}

.tutorial-popup-content small {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Position: Links-Settings (für Settings-Button - links oben) */
.tutorial-right {
    bottom: 12rem;
    left: 2rem;
}

.tutorial-right .tutorial-popup-arrow {
    position: absolute;
    bottom: -10px;
    left: 25px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(40, 40, 50, 0.95);
}

/* Position: Rechts-Fullscreen (für Fullscreen-Button - rechts unten) */
.tutorial-left {
    bottom: 7rem;
    right: 2rem;
}

.tutorial-left .tutorial-popup-arrow {
    position: absolute;
    bottom: -10px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(40, 40, 50, 0.95);
}

/* Position: Rechts-PiP (für PiP-Button - rechts oben) */
.tutorial-right-pip {
    bottom: 12rem;
    right: 2rem;
}

.tutorial-right-pip .tutorial-popup-arrow {
    position: absolute;
    bottom: -10px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(40, 40, 50, 0.95);
}

/* Tutorial Animation */
@keyframes tutorial-fade-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Highlight für aktiven Button */
.tutorial-highlight {
    animation: tutorial-pulse 1.5s infinite ease-in-out;
    z-index: 10000 !important;
}

@keyframes tutorial-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(162, 76, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 20px 8px rgba(162, 76, 255, 0.6);
    }
}


/* ===========================================
   GLASSMORPHISM MODAL
   =========================================== */

/* Backdrop blur */
.modal-backdrop {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background-color: rgba(0, 0, 0, 0.55) !important;
}

/* Modal dialog */
.modal-dialog {
    --glass-bg: rgba(12, 10, 28, 0.72);
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-highlight: rgba(162, 76, 255, 0.18);
}

/* Glass panel */
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(162, 76, 255, 0.12),
        0 12px 48px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    color: #f1f1f1;
    overflow: hidden;
}

/* Subtle top-edge shine */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(162, 76, 255, 0.5), rgba(255, 255, 255, 0.25), rgba(162, 76, 255, 0.5), transparent);
    pointer-events: none;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
    padding: 1.1rem 1.4rem 1rem;
}

.modal-title {
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #fff;
}

.modal-body {
    padding: 1rem 1.25rem 1.4rem;
}

.btn-close {
    filter: invert(1) grayscale(1) brightness(1.4);
    opacity: 0.6;
    transition: opacity 0.15s;
}
.btn-close:hover { opacity: 1; }

.modal-subtitle {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
}

/* Glass form controls */
.modal-content .form-control {
    background: rgba(255, 255, 255, 0.055);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-content .form-control:focus,
.modal-content .form-control:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(162, 76, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(162, 76, 255, 0.18);
    outline: none;
}

.modal-content .form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.modal-content .form-control[type="file"]::-webkit-file-upload-button {
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
}

.modal-content .form-control[type="file"]::file-selector-button {
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
}

/* --- Glass Tabs --- */
.nav-tabs {
    border-bottom: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 4px;
    gap: 3px;
    display: flex;
}

.nav-tabs .nav-item { flex: 1; }

.nav-tabs .nav-link {
    color: rgba(255, 255, 255, 0.45);
    border: none;
    border-radius: 9px;
    padding: 0.45rem 0.5rem;
    font-size: 0.88rem;
    font-weight: 500;
    text-align: center;
    width: 100%;
    transition: color 0.2s, background 0.2s;
}

.nav-tabs .nav-link.active {
    color: #fff;
    background: rgba(162, 76, 255, 0.28);
    border: none;
    border-bottom: none;
    box-shadow:
        0 2px 10px rgba(162, 76, 255, 0.25),
        inset 0 0 0 1px rgba(162, 76, 255, 0.35);
}

.nav-tabs .nav-link:hover:not(.active) {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.07);
}

.tab-content {
    padding-top: 1.1rem;
}

/* --- Glass list group (toggles) --- */
.list-group-item {
    padding-left: 0;
    padding-right: 0;
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
}

/* Glass card wrapper for toggle sections */
.list-group.list-group-flush {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0 0.75rem;
}

.form-check-label {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.82);
}

/* Glass range slider */
.modal-content .form-range {
    accent-color: var(--primary);
}

/* Glass form-switch track */
.modal-content .form-check-input[type="checkbox"] {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.modal-content .form-check-input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Theme Swatches */
.theme-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0.5rem 0;
}

.theme-swatch {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.theme-swatch:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.theme-swatch.active {
    border-color: rgba(162, 76, 255, 0.8);
    box-shadow: 0 0 12px rgba(162, 76, 255, 0.5);
}

/* Custom Color Swatch */
.custom-color-swatch {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, border-color 0.2s;
}

.custom-color-swatch:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.custom-color-swatch i {
    color: white;
    text-shadow: 0 0 3px black;
}

.custom-color-swatch input[type="color"] {
    position: absolute;
    width: 100px;
    height: 100px;
    top: -25px;
    left: -25px;
    opacity: 0;
    cursor: pointer;
}

/* Font Buttons */
.font-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 0.5rem 0;
}

.font-btn {
    background: rgba(255, 255, 255, 0.055);
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    padding: 5px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    backdrop-filter: blur(4px);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.font-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.font-btn.active {
    background: rgba(162, 76, 255, 0.22);
    border-color: rgba(162, 76, 255, 0.55);
    color: #fff;
    box-shadow: 0 0 10px rgba(162, 76, 255, 0.3);
}

/* Color Previews */
.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 0.5rem 0;
}

.color-preview-btn {
    width: 100px;
    height: 60px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    transition: background-image 0.5s ease, background-color 0.5s ease, border-color 0.2s, box-shadow 0.2s;
    background-size: cover;
    background-position: center;
    position: relative;
    backdrop-filter: blur(4px);
}

.color-preview-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.color-preview-btn>span {
    transition: color 0.5s, text-shadow 0.5s;
}

/* Advanced Color Picker Styles */
#advancedColorPicker {
    padding: 0 0.5rem;
}

/* Glass section cards (for subsections in design tab) */
.modal-body hr {
    border-color: rgba(255, 255, 255, 0.08);
    opacity: 1;
    margin: 1rem 0;
}

#advancedColorPicker .form-control-color {
    width: 60px;
    height: 40px;
    padding: 0.2rem;
}

/* User Preset Button Wrapper */
.user-preset-wrapper {
    position: relative;
}

/* Delete Preset Button */
.delete-preset-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: rgba(30, 20, 50, 0.85);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(4px);
    transition: background 0.2s, color 0.2s;
}

.delete-preset-btn:hover {
    background: rgba(220, 53, 69, 0.7);
    color: #fff;
    border-color: rgba(220, 53, 69, 0.5);
}


/*
--- 1. THEMES (Backgrounds Only) ---
*/

.theme-default {
    background-color: #0B1020;
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 60%, 25%, 0.4) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(280, 70%, 30%, 0.5) 0px, transparent 50%);
}

body.theme-default {
    --bs-body-color: #b2b2b2;
}

.theme-swatch.theme-default {
    background: linear-gradient(45deg, #0B1020 50%, hsla(280, 70%, 30%, 0.5) 50%);
}

.theme-digital {
    background-color: #000000;
    background-image: none;
}

body.theme-digital p {
    color: #999;
}

.theme-swatch.theme-digital {
    background-color: #000;
}

.theme-minimal {
    background-color: #f0f0f0;
    background-image: none;
}

body.theme-minimal p {
    color: #333;
}

body.theme-minimal #settings-button,
body.theme-minimal #fullscreen-button,
body.theme-minimal #home-button,
body.theme-minimal #pip-button {
    color: rgba(0, 0, 0, 0.7);
    background: rgba(255, 255, 255, 0.3);
}

.theme-swatch.theme-minimal {
    background-color: #f0f0f0;
}

.theme-ocean {
    background-color: #005c97;
    background-image: linear-gradient(to top, #005c97, #363795);
}

body.theme-ocean p {
    color: #fff;
    opacity: 0.8;
}

.theme-swatch.theme-ocean {
    background: linear-gradient(to top, #005c97, #363795);
}

.theme-sunset {
    background-color: #ff9a9e;
    background-image: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
}

body.theme-sunset p {
    color: #fff;
    opacity: 0.9;
}

.theme-swatch.theme-sunset {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
}

.theme-retro {
    background-color: #0f0c29;
    background-image: linear-gradient(to right, #302b63, #24243e, #0f0c29);
}

body.theme-retro p {
    color: #ccc;
    opacity: 0.7;
}

.theme-swatch.theme-retro {
    background: #0f0c29;
}

.theme-elegant {
    background-color: #232526;
    background-image: linear-gradient(to top, #232526, #414345);
}

body.theme-elegant p {
    color: #ccc;
    opacity: 0.7;
}

.theme-swatch.theme-elegant {
    background: #232526;
}

/*
--- 3. COLOR CLASSES (Timer Color & Shadow) ---
*/

/* --- Single Colors --- */
.color-white,
#timerBox.color-white>.timer-min,
#timerBox.color-white>.timer-sec,
#timerBox.color-white>.timer-colon {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.color-neon-green,
#timerBox.color-neon-green>.timer-min,
#timerBox.color-neon-green>.timer-sec,
#timerBox.color-neon-green>.timer-colon {
    color: #00ff41;
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.7);
}

.color-black,
#timerBox.color-black>.timer-min,
#timerBox.color-black>.timer-sec,
#timerBox.color-black>.timer-colon {
    color: #1a1a1a;
    text-shadow: none;
}

.color-light-gold,
#timerBox.color-light-gold>.timer-min,
#timerBox.color-light-gold>.timer-sec,
#timerBox.color-light-gold>.timer-colon {
    color: #E6DADA;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.color-hot-pink,
#timerBox.color-hot-pink>.timer-min,
#timerBox.color-hot-pink>.timer-sec,
#timerBox.color-hot-pink>.timer-colon {
    color: #ff00c1;
    text-shadow: 0 0 15px rgba(255, 0, 193, 0.7);
}

.color-orange,
#timerBox.color-orange>.timer-min,
#timerBox.color-orange>.timer-sec,
#timerBox.color-orange>.timer-colon {
    color: #ff8c00;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.color-neon-blue,
#timerBox.color-neon-blue>.timer-min,
#timerBox.color-neon-blue>.timer-sec,
#timerBox.color-neon-blue>.timer-colon {
    color: #00e5ff;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.7);
}

/* Extra single colors */
.color-soft-pink,
#timerBox.color-soft-pink>.timer-min,
#timerBox.color-soft-pink>.timer-sec,
#timerBox.color-soft-pink>.timer-colon {
    color: #FFC1CC;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.color-warm-beige,
#timerBox.color-warm-beige>.timer-min,
#timerBox.color-warm-beige>.timer-sec,
#timerBox.color-warm-beige>.timer-colon {
    color: #F5E8D8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.color-muted-coral,
#timerBox.color-muted-coral>.timer-min,
#timerBox.color-muted-coral>.timer-sec,
#timerBox.color-muted-coral>.timer-colon {
    color: #FF6F61;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.color-light-cyan,
#timerBox.color-light-cyan>.timer-min,
#timerBox.color-light-cyan>.timer-sec,
#timerBox.color-light-cyan>.timer-colon {
    color: #A8DADC;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.color-cobalt-blue,
#timerBox.color-cobalt-blue>.timer-min,
#timerBox.color-cobalt-blue>.timer-sec,
#timerBox.color-cobalt-blue>.timer-colon {
    color: #2196F3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}


/* --- Multi-Colors --- */
#timerBox.color-white-blue>.timer-min,
#timerBox.color-white-blue>.timer-colon {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#timerBox.color-white-blue>.timer-sec {
    color: #00e5ff;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.7);
}

#timerBox.color-pink-green>.timer-min,
#timerBox.color-pink-green>.timer-colon {
    color: #ff00c1;
    text-shadow: 0 0 15px rgba(255, 0, 193, 0.7);
}

#timerBox.color-pink-green>.timer-sec {
    color: #00ff41;
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.7);
}

#timerBox.color-orange-white>.timer-min,
#timerBox.color-orange-white>.timer-colon {
    color: #ff8c00;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#timerBox.color-orange-white>.timer-sec {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Multi-Colors */
#timerBox.color-mint-pink>.timer-min,
#timerBox.color-mint-pink>.timer-colon {
    color: #A8DADC;
    /* light cyan */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#timerBox.color-mint-pink>.timer-sec {
    color: #FFC1CC;
    /* soft pink */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#timerBox.color-beige-coral>.timer-min,
#timerBox.color-beige-coral>.timer-colon {
    color: #F5E8D8;
    /* warm beige */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#timerBox.color-beige-coral>.timer-sec {
    color: #FF6F61;
    /* muted coral */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#timerBox.color-white-cobalt>.timer-min,
#timerBox.color-white-cobalt>.timer-colon {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#timerBox.color-white-cobalt>.timer-sec {
    color: #2196F3;
    /* cobalt blue */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.subtitle-text {
    font-size: 1.2rem;
}

.hidden-advanced-color-picker {
    display: none;
}

.hidden-file-input {
    display: none;
}

/* Advanced Swatches - Rectangular style like Simple Mode */
.adv-swatch-rect {
    width: 65px !important;
    height: 48px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    font-size: 1.3rem !important;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.adv-swatch-rect:hover {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.07) !important;
}

.adv-swatch-rect.active {
    border-color: rgba(162, 76, 255, 0.7) !important;
    box-shadow: 0 0 10px rgba(162, 76, 255, 0.4), inset 0 0 0 1px rgba(162, 76, 255, 0.3) !important;
}

/* Glass buttons inside modal */
.modal-content .btn-primary {
    background: rgba(162, 76, 255, 0.3);
    border: 1px solid rgba(162, 76, 255, 0.5);
    backdrop-filter: blur(6px);
    color: #fff;
    font-weight: 500;
    border-radius: 10px;
    transition: background 0.2s, box-shadow 0.2s;
}

.modal-content .btn-primary:hover {
    background: rgba(162, 76, 255, 0.45);
    box-shadow: 0 0 16px rgba(162, 76, 255, 0.35);
    border-color: rgba(162, 76, 255, 0.7);
}

.modal-content .btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    transition: background 0.2s, border-color 0.2s;
}

.modal-content .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Custom Color Trigger */
.custom-trigger {
    width: 65px !important;
    height: 48px !important;
    border: 1px dashed rgba(255, 255, 255, 0.2) !important;
    border-radius: 10px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.custom-trigger:hover {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.09) !important;
}

.custom-color-wrapper {
    position: relative;
    display: inline-block;
}

/* ===========================================
   FEIERABEND-BAR STYLES 
   =========================================== */

/* Progress Bar Container - transparent, matches background */
.progress-container {
    background: transparent;
    border: none;
    padding: 1rem 2rem;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    margin: 0 auto;
    margin-top: 1.5rem;
}

/* Hidden state for progress bar */
.progress-container.hidden {
    display: none !important;
}

/* Progress Bar Track */
.progress-container .progress {
    height: 30px;
    font-size: 1rem;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--primary-border);
    border-radius: 8px;
}

/* Progress Bar Fill - uses CSS variable for color */
.progress-container .progress-bar {
    --bar-color: var(--primary);
    /* Default, will be overwritten by JS */
    background-color: var(--bar-color);
    animation: pulse-bar 2s infinite ease-in-out;
    transition: width 0.5s ease-out, background-color 0.3s ease;
}

/* Pulse Animation für atmenden Effekt - uses CSS variable */
@keyframes pulse-bar {
    0% {
        box-shadow: 0 0 5px 0px var(--bar-color);
    }

    50% {
        box-shadow: 0 0 20px 5px var(--bar-color);
    }

    100% {
        box-shadow: 0 0 5px 0px var(--bar-color);
    }
}

/* Zeit-Anzeige Labels */
.progress-container .time-display {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
}

.progress-container .time-label {
    color: #888;
    font-size: 0.85rem;
}

.progress-container .time-info {
    padding: 0 0.5rem;
}

/* Progress Text */
#progress-text {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ===========================================
   KONFETTI STYLES 
   =========================================== */

/* Konfetti-Container (für Positionierung) */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Konfetti-Partikel */
.confetti {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    background-color: #f00;
    opacity: 1;
    pointer-events: none;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(105vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===========================================
   RESPONSIVE ADJUSTMENTS 
   =========================================== */

/* Tablet & Mobile Portrait */
@media (max-width: 768px) {
    main {
        padding-bottom: 90px !important;
    }

    #timerBox {
        --timer-size: clamp(3rem, 24vw, 20rem);
    }

    #timerBox.large-size {
        --timer-size: clamp(4rem, 30vw, 25rem);
    }

    .subtitle-text {
        font-size: 1rem;
        padding: 0 1rem;
    }

    #settings-button,
    #fullscreen-button,
    #home-button,
    #pip-button {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.25rem;
    }

    #home-button {
        left: 1rem;
        bottom: 1rem;
    }

    #fullscreen-button {
        right: 1rem;
        bottom: 1rem;
    }

    #settings-button {
        left: 1rem;
        bottom: 5rem;
    }

    #pip-button {
        right: 1rem;
        bottom: 5rem;
    }

    /* Tutorial adjustments for mobile */
    .tutorial-popup {
        max-width: 250px;
    }

    .tutorial-right {
        bottom: 9rem;
        left: 1rem;
    }

    .tutorial-left {
        bottom: 5rem;
        right: 1rem;
    }

    .tutorial-right-pip {
        bottom: 9rem;
        right: 1rem;
    }

    .progress-container {
        padding: 0.75rem 1rem;
        margin: 1rem 0.5rem 0;
        max-width: 100%;
        width: 95%;
    }
}

/* Mobile Landscape */
@media (max-height: 500px) and (orientation: landscape) {
    main {
        padding-bottom: 60px !important;
    }

    #timerBox {
        --timer-size: clamp(4rem, 40vh, 15rem);
        padding: 0.5rem;
    }

    #timerBox.large-size {
        --timer-size: clamp(5rem, 50vh, 20rem);
    }

    .subtitle-text {
        font-size: 0.9rem;
        margin-top: 0.5rem !important;
        margin-bottom: 0 !important;
    }

    .progress-container {
        margin-top: 0.25rem;
        padding: 0.5rem 1rem;
    }

    .progress-container .progress {
        height: 20px;
    }

    #settings-button,
    #fullscreen-button,
    #home-button,
    #pip-button {
        width: 3rem;
        height: 3rem;
        font-size: 1.1rem;
        bottom: 0.5rem;
    }

    #home-button {
        left: 0.5rem;
    }

    #fullscreen-button {
        right: 0.5rem;
    }

    #settings-button {
        left: 4rem;
        bottom: 0.5rem;
    }

    #pip-button {
        right: 4rem;
        bottom: 0.5rem;
    }

    /* Hide subtitle in very tight landscape to save space */
    @media (max-height: 400px) {
        .subtitle-text {
            display: none !important;
        }
    }

    /* Modal adjustments for landscape */
    .modal-dialog {
        max-width: 95%;
        margin: 0.5rem auto;
    }

    .modal-body {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* Modal Tab Adjustments */
@media (max-width: 576px) {
    .nav-tabs .nav-link {
        padding: 0.5rem 0.2rem;
        font-size: 0.8rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }
}

/* Extra small mobile adjustments */
@media (max-width: 400px) {
    #timerBox {
        --timer-size: clamp(2.5rem, 28vw, 15rem);
    }

    .progress-container .time-display {
        font-size: 0.85rem;
    }

    .progress-container .time-label {
        font-size: 0.7rem;
    }
}

/* ===========================================
   PROGRESS BAR VISIBILITY TOGGLES 
   =========================================== */

/* Hide time info (start/end) */
.progress-container.hide-times .time-info>div:first-child,
.progress-container.hide-times .time-info>div:last-child {
    display: none !important;
}

/* Hide current time */
.progress-container.hide-current-time .time-info>div:nth-child(2) {
    display: none !important;
}

/* Center remaining time info when others are hidden */
.progress-container.hide-times .time-info {
    justify-content: center !important;
}

/* Hide entire time info row if both times and current time are hidden */
.progress-container.hide-times.hide-current-time .time-info {
    display: none !important;
}

/* Hide percent text inside progress bar */
.progress-container.hide-percent #progress-text {
    visibility: hidden;
}

/* ===========================================
   APPLE WATCH OPTIMIZATION (≤220px)
   Timer fills screen, all chrome hidden
   =========================================== */

@media (max-width: 220px) {

    /* Center timer on full screen */
    body {
        overflow: hidden;
    }

    main {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 100vh !important;
        width: 100% !important;
        padding: 0.25rem !important;
        margin: 0 !important;
    }

    /* Timer display – maximize readability */
    #timerBox {
        --timer-size: clamp(1.8rem, 28vw, 3.5rem) !important;
        width: 100%;
        padding: 0 !important;
    }

    #timerBox.large-size {
        --timer-size: clamp(2rem, 32vw, 4rem) !important;
    }

    /* Hide subtitle */
    .subtitle-text {
        display: none !important;
    }

    /* Hide all fixed buttons */
    #settings-button,
    #fullscreen-button,
    #home-button,
    #pip-button {
        display: none !important;
    }

    /* Hide progress bar section entirely */
    .progress-container,
    #progress-section {
        display: none !important;
    }

    /* Hide tutorial popups and overlay */
    .tutorial-popup,
    .tutorial-overlay {
        display: none !important;
    }

    /* Hide modal (can't use on watch) */
    .modal,
    .modal-backdrop {
        display: none !important;
    }

    /* Hide confetti and snowflakes */
    #confetti-container,
    #snowflake-container {
        display: none !important;
    }
}