.hidden {
    display: none !important;
}

/* *********************************************
   HEADER
********************************************** */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.nav-bar {
    backdrop-filter: blur(18px);
    background: linear-gradient(
        to bottom,
        rgba(15, 23, 42, 0.85),
        rgba(15, 23, 42, 0.65)
    );
}
body.theme-light .nav-bar {
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.85),
        rgba(255,255,255,0.65)
    );
}

.site-logo img {
    height: 80px;
    width: auto;
    display: block;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Hover animation */
.site-logo:hover img {
    opacity: 0.85;
    transform: scale(1.04);
}

.site-logo img {
    opacity: 0;
    animation: logoFade 0.4s ease forwards;
}

@keyframes logoFade {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}
/*
.logo {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.04em;
}
.logo span {
    color: var(--accent);
}
*/
.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* *********************************************
   NAV TABS
********************************************** */
.nav-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    background: transparent;
    color: var(--fg);
    border: 1px solid transparent;
    transition: 
        background 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease,
        transform 0.2s ease;
    position: relative;
}

/* Hover animation */
.nav-tab:hover {
    background: rgba(255,255,255,0.06);
    transform: translateY(-1px);
}

body.theme-light .nav-tab:hover {
    background: rgba(0,0,0,0.06);
}

.nav-tab.active {
    background: var(--tab-active);
    color: var(--fg);
    border-color: rgba(148, 163, 184, 0.6);
	box-shadow: 0 0 12px rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

body.theme-light .nav-tab.active {
    background: var(--tab-active);
    color: var(--fg);
    border-color: rgba(0,0,0,0.12);
    box-shadow: 0 0 12px rgba(0,0,0,0.12);
}


/* Underline animation */
.nav-tab::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 3px;
    background: var(--accent);
    transform: translateX(-50%);
    transition: width 0.25s ease;
}

.nav-tab.active::after {
    width: 60%;
	box-shadow: 0 0 6px var(--fg);
}

.nav-tab i {
    font-size: 1rem;
    opacity: 0.9;
    transition: opacity 0.25s ease;
}

.nav-tab:hover i {
    opacity: 1;
}

.nav-tab span {
    vertical-align: middle;
}

.nav-tabs-container {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    scrollbar-width: none;
}

.nav-tabs-container::-webkit-scrollbar {
    display: none;
}

@media (max-width: 600px) {
    .nav-tab span {
        display: none;
    }

    .nav-tab {
        padding: 0.55rem 0.7rem;
        gap: 0;
        justify-content: center;
    }

    .nav-tab i {
        font-size: 1.2rem;
        margin-right: 0;
    }
}

/* *********************************************
   MAIN CONTAINER
********************************************** */
.main-container {
    max-width: 960px;
    margin: 1.5rem auto 2rem;
    padding: 0 1rem 2rem;
}

/* *********************************************
   TAB PANELS (with fade/slide animation)
********************************************** */
.tab-panel {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    display: none;
}
.tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    padding: 20px;
}

.tab-panel h1 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
}

/* *********************************************
   TIMER DISPLAY
********************************************** */
.timer-display {
    font-variant-numeric: tabular-nums;
    font-size: 3rem;
    text-align: center;
    margin: 1rem 0 0.8rem;
    padding: 0.7rem 1rem;
    border-radius: 18px;
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
    transition: font-size 0.25s ease;
}
.timer-display.hours {
    font-size: 2.4rem;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.hint {
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.8rem;
}

/* *********************************************
   LAPS TABLE
********************************************** */
.laps-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}
.laps-table th,
.laps-table td {
    padding: 0.35rem 0.4rem;
    text-align: right;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}
.laps-table th:first-child,
.laps-table td:first-child {
    text-align: left;
}

/* *********************************************
   INPUT GROUPS
********************************************** */
.countdown-inputs,
.pom-settings,
.interval-config {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.countdown-inputs label,
.pom-settings label,
.interval-config label {
    font-size: 0.8rem;
    color: var(--muted);
}

.countdown-inputs input,
.pom-settings input,
.interval-config input {
    width: 4rem;
    padding: 0.25rem 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
/*    background: rgba(15, 23, 42, 0.9);*/
    background: var(--bg-alt);
    color: var(--fg);
}

/* Light theme input overrides */
body.theme-light label {
    color: var(--fg);
}
body.theme-light input {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--fg);
}


/* *********************************************
   INTERVAL
********************************************** */

#int-container {
    padding: 1rem;
    border-radius: 12px;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* High phase background */
.int-high-bg {
    background: rgba(255, 80, 80, 0.15);
    box-shadow: 0 0 20px rgba(255, 80, 80, 0.25);
}

/* Low phase background */
.int-low-bg {
    background: rgba(80, 180, 255, 0.15);
    box-shadow: 0 0 20px rgba(80, 180, 255, 0.25);
}


/* *********************************************
   POMODORO
********************************************** */

/* Container for Pomodoro (wrap your pomodoro UI in this) */
#pom-container {
    transition: background 0.4s ease, box-shadow 0.4s ease;
    padding: 1rem;
    border-radius: 12px;
}

/* Work phase background */
.pom-work-bg {
    background: rgba(255, 80, 80, 0.15);
    box-shadow: 0 0 20px rgba(255, 80, 80, 0.25);
}

/* Break phase background */
.pom-break-bg {
    background: rgba(80, 255, 140, 0.15);
    box-shadow: 0 0 20px rgba(80, 255, 140, 0.25);
}

#pom-status {
    display: inline-block;
    padding: 1.45rem 2rem;
    margin: 60px auto 0.8rem auto;   /* center horizontally */
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.03em;
    text-align: center;

    color: var(--accent);
    border: 2px solid var(--accent);
    background: rgba(0, 0, 0, 0.15);

    box-shadow: 0 0 12px rgba(77, 163, 255, 0.35);

    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    opacity: 0.95;

    /* NEW: center the element */
    display: block;
    width: fit-content;
}

#pom-status.pop {
    transform: scale(1.10);
    box-shadow: 0 0 18px rgba(77, 163, 255, 0.55);
    opacity: 1;
}


/* *********************************************
   MULTI TIMER
********************************************** */
.multi-timer-list {
    margin-top: 1rem;
    display: grid;
    gap: 0.7rem;
}

.multi-timer-card {
    padding: 0.7rem 0.8rem;
    border-radius: 16px;
    background: var(--bg-alt);
    border: 1px solid rgba(148, 163, 184, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.multi-timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.multi-timer-display {
    font-variant-numeric: tabular-nums;
    font-size: 1.4rem;
}

.multi-timer-controls {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* *********************************************
   GROUP GENERATOR
********************************************** */

/* Group Generator Styling */
#tab-groupgen .tool-card {
    background: var(--bg-alt);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    max-width: 700px;
    margin: 0 auto;
}

#tab-groupgen .tool-title {
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--fg);
}

#tab-groupgen .input-row {
    margin-bottom: 1.25rem;
}

#tab-groupgen .input-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--fg);
    opacity: 0.85;
}

#tab-groupgen .input-textarea {
    width: 100%;
    height: 120px;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--muted, #4b5563);
    resize: vertical;
}

#tab-groupgen .input-number {
    width: 70px;
    padding: 0.4rem;
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--muted, #4b5563);
}

#tab-groupgen .gg-mode-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#tab-groupgen .gg-radio {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--fg);
}

#tab-groupgen .primary-btn.full-width {
    width: 100%;
    margin-top: 0.5rem;
}

#tab-groupgen .gg-output {
    margin-top: 1.5rem;
    display: grid;
    gap: 1rem;
}

/* Group cards reuse your multi-timer-card style */
#tab-groupgen .multi-timer-card {
    padding: 1rem;
    border-radius: 10px;
    background: var(--bg);
    box-shadow: var(--shadow-sm);
}

#tab-groupgen .multi-timer-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--fg);
}

/* *********************************************
   METRONOME
********************************************** */
#tab-metronome .input-range {
    width: 100%;
}

#tab-metronome .range-value {
    margin-top: 0.35rem;
	margin-bottom: 1rem;
    font-size: 0.9rem;
    opacity: 0.85;
    color: var(--fg);
}

.metro-visual {
    margin-top: 1.5rem;
    width: 100%;
    height: 20px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
}

.metro-visual::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--fg);
    opacity: 0.8;
    transition: width 0.1s ease;
}

/* Retro triangular wooden case */
#metro-case {
    width: 180px;
    height: 280px;
    margin: 2rem auto;
    position: relative;
    background: linear-gradient(135deg, #5a3e1b, #3d2812);
    box-shadow: 0 10px 24px rgba(0,0,0,0.4);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

/* Glass front panel */
#metro-glass {
    position: absolute;
    inset: 8px 10px 16px 10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02));
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.18);
    pointer-events: none;
}

/* Tempo scale on the case */
#metro-scale {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.7rem;
    color: #f5e6c8;
    opacity: 0.9;
    font-family: monospace;
}

/* Pendulum (upside-down inside case) */
#metro-pendulum {
    position: absolute;
    bottom: 90px;      /* instead of top */
    left: 50%;
    width: 4px;
    height: 200px;
    background: var(--fg);
    transform-origin: bottom center;   /* <-- THIS is the key */
    transform: rotate(0deg);
}

/* Weight slider on the pendulum */
#metro-weight {
    width: 26px;
    height: 14px;
    background: #d4c29a;
    border-radius: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 40%; /* JS will update */
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Bob at the bottom */
#metro-bob {
    width: 22px;
    height: 22px;
    background: var(--fg);
    border-radius: 50%;
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Swinging shadow */
#metro-shadow {
    width: 8px;
    height: 150px;
    background: rgba(0,0,0,0.25);
    position: absolute;
    top: 0;
    left: 50%;
    transform-origin: top center;
    transform: rotate(0deg);
    filter: blur(4px);
}

/* *********************************************
   EXAM TIMER
********************************************** */

.exam-layout {
    display: flex;
    gap: 6rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* Increase spacing between clock and controls when fullscreen */
:fullscreen .exam-layout,
#exam-container:fullscreen .exam-layout {
    gap: 8rem; /* or 5rem if you want even more space */
    padding-top: 1rem;
}

.exam-digital-time {
    margin-top: 0.5rem;
    font-size: 1.6rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 1px;
}

#exam-analog {
    background: var(--bg-alt);
    border-radius: 50%;
    box-shadow: 0 0 25px rgba(0,0,0,0.35);
}

.exam-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 240px;
}

.exam-countdown {
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
    margin-top: 0.5rem;
    color: var(--accent);
}

.exam-extra {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.exam-display-line {
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
}

.exam-text {
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.4);
    background: var(--bg);
    color: var(--fg);
    font-size: 0.95rem;
}

.exam-elapsed {
    font-size: 1.1rem;
    opacity: 0.85;
    text-align: center;
    margin-top: -0.5rem;
    font-variant-numeric: tabular-nums;
}

#exam-container:fullscreen {
    background: var(--bg);
    padding: 2rem;
}

#exam-container:fullscreen canvas {
    transform: scale(1.2);
}

#exam-container:fullscreen .exam-controls {
    transform: scale(1.1);
}

/* Make countdown dominant */
.prominent-countdown {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin: 1rem 0 1.5rem 0;
    letter-spacing: 2px;
    color: var(--fg);
}

/* Subtle fullscreen button */
.exam-fullscreen-btn {
    background: transparent;
    border: 1px solid var(--muted, #6b7280);
    color: var(--muted, #6b7280);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    width: fit-content;
    margin: 0.5rem auto 0 auto;
    display: block;
    opacity: 0.7;
    transition: 0.2s ease;
}

.exam-fullscreen-btn:hover {
    opacity: 1;
    border-color: var(--fg);
    color: var(--fg);
}

/* Ensure the countdown stays visible even in light themes */
.theme-light .prominent-countdown {
    color: #000;
}

/* READING TIME THEME (blue) */
.exam-reading-theme .exam-countdown,
.exam-reading-theme .exam-digital-time,
.exam-reading-theme .exam-elapsed {
    color: #1d4ed8 !important; /* blue-700 */
}

.exam-reading-theme #exam-analog {
    filter: drop-shadow(0 0 6px rgba(29, 78, 216, 0.6));
}

/* EXAM TIME THEME (red) */
.exam-exam-theme .exam-countdown,
.exam-exam-theme .exam-digital-time,
.exam-exam-theme .exam-elapsed {
    color: #dc2626 !important; /* red-600 */
}

.exam-exam-theme #exam-analog {
    filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.6));
}

.exam-countdown-wrapper {
    text-align: center;
    margin-top: 1rem;
}

.exam-countdown-label {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
    color: var(--fg);
}

.prominent-countdown {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--fg);
}

/* Light theme override */
.theme-light .exam-countdown-label,
.theme-light .prominent-countdown {
    color: #000;
}

/* *********************************************
   REACTION TEST
********************************************** */
.reaction-area {
    margin-top: 1rem;
    border-radius: 18px;
    padding: 2.5rem 1rem;
    text-align: center;
    font-size: 1.2rem;
    user-select: none;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.reaction-area.idle {
    background: rgba(15, 23, 42, 0.96);
}
.reaction-area.wait {
    background: #facc15;
    color: #111827;
}
.reaction-area.go {
    background: #22c55e;
    color: #022c22;
    box-shadow: 0 18px 40px rgba(34, 197, 94, 0.55);
    transform: translateY(-1px);
}
#react-result {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-top: 0.6rem;
    color: var(--accent);
    text-shadow: 0 0 12px rgba(77, 163, 255, 0.45);
    letter-spacing: 0.03em;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

#react-result.show {
    opacity: 1;
    transform: scale(1.08);
}

/* *********************************************
   FOOTER
********************************************** */
.site-footer {
    max-width: 960px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.85;
}

/* *********************************************
   MOBILE
********************************************** */
@media (max-width: 720px) {
    .site-header {
        flex-wrap: wrap;
        gap: 0.6rem;
    }
    .main-container {
        padding: 0 0.8rem 1.5rem;
    }
    .tab-panel {
        padding: 1.1rem 1rem 1.3rem;
        border-radius: 20px;
    }
    .timer-display {
        font-size: 2.2rem;
    }
    .site-footer {
        flex-direction: column;
        gap: 0.2rem;
        align-items: flex-start;
    }
}

/* *********************************************
   LIGHT THEME BUTTON FIXES
********************************************** */
body.theme-light .primary-btn {
    background: var(--accent);
    color: #ffffff;
}
body.theme-light .ghost-btn {
    background: var(--btn-bg-light);
    color: var(--btn-text-light);
    border: 1px solid var(--border);
}


/* *********************************************
   CONTACT FORM
********************************************** */

.contact-form {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.contact-form label {
    font-size: 0.85rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.contact-form input,
.contact-form textarea {
    padding: 0.5rem 0.7rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.9);
    color: var(--fg);
    font-size: 0.9rem;
}

.contact-form textarea {
    resize: vertical;
}
