:root {
    /* DARK THEME (Default) */
    --bg-color: #0b0c10;
    --text-main: #ffffff;
    --text-muted: #8892b0;
    --accent-1: #8A2BE2;
    /* Aesthetic purple */
    --accent-2: #ff2a5f;
    /* Aesthetic pink/red */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.4);
    --input-bg: rgba(0, 0, 0, 0.3);
    --panel-bg: rgba(0, 0, 0, 0.15);
}

body.light-mode {
    --bg-color: #f3f4f6;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --accent-1: #6d28d9;
    --accent-2: #e11d48;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-hover: rgba(0, 0, 0, 0.05);
    --glass-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.1);
    --input-bg: rgba(255, 255, 255, 0.9);
    --panel-bg: rgba(255, 255, 255, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
    background-color: var(--bg-color);
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Animated Glows */
.background-animation {
    position: absolute;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 25s infinite alternate ease-in-out;
}

.orb-1 {
    width: 450px;
    height: 450px;
    background: var(--accent-1);
    top: -150px;
    left: 5%;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: var(--accent-2);
    bottom: -100px;
    right: 15%;
    animation-delay: -5s;
    animation-duration: 20s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: #00d2ff;
    top: 40%;
    left: 35%;
    animation-delay: -12s;
    opacity: 0.2;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(120px, 80px) scale(1.1);
    }

    100% {
        transform: translate(-80px, 120px) scale(0.9);
    }
}

/* Glass Panel Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Layout Wrapper */
.layout-wrapper {
    position: relative;
    z-index: 1;
    width: 95%;
    max-width: 1500px;
    height: 90vh;
    height: 90dvh;
    display: flex;
    gap: 25px;
}

/* Sidebar */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 30px 25px 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 28px;
    color: var(--accent-1);
}

.logo {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo span {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 15px 30px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-nav::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
.alarms-list::-webkit-scrollbar,
.laps-container::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb,
.alarms-list::-webkit-scrollbar-thumb,
.laps-container::-webkit-scrollbar-thumb {
    background: rgba(136, 146, 176, 0.3);
    border-radius: 10px;
}

.nav-group-title {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 15px 15px 5px 15px;
    opacity: 0.7;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    text-align: left;
}

.nav-btn i {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-btn:hover {
    background: var(--glass-hover);
    color: var(--text-main);
}

.nav-btn:hover i {
    color: var(--text-main);
}

.nav-btn.active {
    background: var(--accent-1);
    color: #fff;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

.nav-btn.active i {
    color: #fff;
}

.nav-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 10px 15px;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    border-radius: 24px;
    padding: 40px;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Tool Sections */
.tool-section {
    display: none;
    flex-direction: column;
    flex-grow: 1;
    animation: fadeIn 0.4s ease forwards;
}

.tool-section.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 30px;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 5px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-muted);
}

/* Standard Tools Layout */
.tools-layout {
    display: flex;
    gap: 30px;
    width: 100%;
    margin-top: 20px;
}

.control-panel,
.list-panel {
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    flex: 1;
}

.control-panel h3,
.list-panel h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-panel {
    display: flex;
    flex-direction: column;
}

.narrow-container {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    background: var(--panel-bg);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.align-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Display Container (Clocks/Timers) */
.display-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.static-height {
    min-height: 250px;
}

.time-display {
    font-size: 72px;
    font-weight: 300;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.date-display {
    font-size: 20px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Progress Ring */
.timer-display-container {
    margin-bottom: 40px;
}

.progress-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    transition: opacity 0.3s;
}

.progress-ring__circle,
.progress-ring__progress {
    transition: stroke-dashoffset 0.1s linear;
}

.progress-ring__progress {
    filter: drop-shadow(0 0 8px rgba(138, 43, 226, 0.4));
}

/* Timer Specific Inputs */
.timer-controls-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.timer-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel-bg);
    padding: 15px 25px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    transition: opacity 0.3s;
}

.input-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-block input {
    width: 70px;
    height: 60px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 32px;
    font-weight: 400;
    text-align: center;
    outline: none;
}

.input-block label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.colon {
    font-size: 32px;
    font-weight: 300;
    margin-bottom: 25px;
}

/* Inputs and Forms */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    flex: 1;
}

.text-left {
    align-items: flex-start;
}

.input-group.horizontal {
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.flex-row {
    display: flex;
    gap: 20px;
}

.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="time"],
input[type="date"],
input[type="text"],
input[type="number"].small-input,
select {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    padding: 14px 20px;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 16px;
    outline: none;
    width: 100%;
}

.glass-dropdown {
    cursor: pointer;
    background: var(--input-bg);
}

input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.5);
    cursor: pointer;
    transition: opacity 0.2s;
}

body.light-mode input[type="time"]::-webkit-calendar-picker-indicator,
body.light-mode input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0) opacity(0.5);
}

input[type="time"]:hover::-webkit-calendar-picker-indicator,
input[type="date"]:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

select option {
    background: var(--bg-color);
    color: var(--text-main);
}

.pt-10 {
    padding-top: 10px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-40 {
    margin-top: 40px;
}

.mb-15 {
    margin-bottom: 15px;
}

.full-width {
    width: 100%;
}

/* Buttons */
.controls {
    display: flex;
    gap: 15px;
}

.btn-group-center {
    justify-content: center;
    width: 100%;
    display: flex;
    gap: 15px;
    align-items: center;
}

.action-btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--accent-1), #5b1aa6);
    color: white;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);
}

.action-btn.secondary {
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
}

.action-btn.secondary:hover {
    background: var(--glass-hover);
}

.action-btn.danger {
    background: rgba(255, 42, 95, 0.1);
    color: var(--accent-2);
    border: 1px solid rgba(255, 42, 95, 0.3);
}

.action-btn.danger:hover {
    background: rgba(255, 42, 95, 0.2);
}

/* Lists (Alarms, Laps) */
.alarms-list,
.laps-container {
    flex-grow: 1;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-style: italic;
    font-size: 14px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: transform 0.2s;
}

.list-item:hover {
    transform: translateX(2px);
    background: var(--glass-hover);
}

.list-item .primary-text {
    font-size: 18px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.list-item .secondary-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: auto;
    margin-right: 15px;
}

.delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 42, 95, 0.1);
    color: var(--accent-2);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: var(--accent-2);
    color: white;
}

/* Result Box */
.result-box {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 500;
}

.result-box.lg {
    padding: 25px;
    font-size: 18px;
    color: var(--text-main);
}

.highlight-text {
    color: var(--accent-1);
    font-weight: 800;
    font-size: larger;
}

/* World Clock Grid */
.world-clock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.world-card {
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.world-card h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
}

.world-card .w-time {
    font-size: 36px;
    font-weight: 300;
    color: var(--accent-1);
    margin: 10px 0;
    font-variant-numeric: tabular-nums;
}

.world-card .w-date {
    font-size: 14px;
    color: var(--text-muted);
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.settings-card {
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
}

.settings-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-1);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-info h4 {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.setting-info p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 250px;
}

/* Custom Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--input-bg);
    border: 1px solid var(--glass-border);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent-1);
    border-color: var(--accent-1);
}

input:checked+.slider:before {
    background-color: white;
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Snooze Options */
.snooze-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.snooze-btn {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.snooze-btn.active {
    background: var(--accent-1);
    color: white;
    border-color: var(--accent-1);
}

.snooze-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 5px;
}

/* Range Slider for Volume */
.volume-slider-container {
    width: 100%;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent-1);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--input-bg);
    border-radius: 3px;
    border: 1px solid var(--glass-border);
}

.range-ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 5px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Event Countdown Formats */
.countdown-display-box {
    background: linear-gradient(to bottom right, var(--panel-bg), var(--input-bg));
    border: 1px solid var(--glass-border);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal {
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-icon {
    font-size: 48px;
    color: var(--accent-1);
    margin-bottom: 20px;
}

.ring-animation {
    animation: ring 0.5s infinite alternate ease-in-out;
    transform-origin: top center;
}

@keyframes ring {
    0% {
        transform: rotate(-15deg);
    }

    100% {
        transform: rotate(15deg);
    }
}

.modal h2 {
    font-size: 48px;
    font-weight: 300;
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
}

.modal p {
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* SEO Article */
.seo-content {
    background: var(--input-bg);
    padding: 30px;
    border-radius: 20px;
    line-height: 1.6;
    color: var(--text-muted);
}

.seo-content h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 15px;
}

.seo-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 10px;
}

.faq-item strong {
    display: block;
    color: var(--text-main);
    margin-bottom: 5px;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 50;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-main);
}

/* Tool Section Fullscreen Styles */
.tool-section:fullscreen {
    background-color: var(--bg-color);
    padding: 60px 10%;
    overflow-y: auto;
}

.tool-section:-webkit-full-screen {
    background-color: var(--bg-color);
    padding: 60px 10%;
    overflow-y: auto;
}

.tool-section:fullscreen .time-display {
    font-size: 15vw !important;
}

.tool-section:-webkit-full-screen .time-display {
    font-size: 15vw !important;
}

.tool-section:fullscreen #cd-result .time-display {
    font-size: 9vw !important;
}

.tool-section:-webkit-full-screen #cd-result .time-display {
    font-size: 9vw !important;
}

.tool-section:fullscreen .action-btn i.fa-expand::before {
    content: "\f066" !important;
}

.tool-section:-webkit-full-screen .action-btn i.fa-expand::before {
    content: "\f066" !important;
}

.tool-section:fullscreen .seo-content {
    display: none !important;
}

.tool-section:-webkit-full-screen .seo-content {
    display: none !important;
}

@media (max-width: 1024px) {
    .layout-wrapper {
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        width: 100%;
        padding: 0;
        gap: 0;
    }

    .sidebar {
        width: 100%;
        border-radius: 0;
        height: 100vh;
        height: 100dvh;
        position: fixed;
        top: 0;
        left: -100%;
        z-index: 40;
        transition: left 0.3s ease;
        background: var(--bg-color);
    }

    .sidebar.open {
        left: 0;
        border-right: 1px solid var(--glass-border);
    }

    .main-content {
        border-radius: 0;
        height: 100vh;
        height: 100dvh;
        padding: 80px 20px 20px 20px;
    }

    .mobile-menu-btn {
        display: flex;
        justify-content: center;
        align-items: center;
        background: var(--panel-bg);
    }

    .tools-layout {
        flex-direction: column;
    }

    .time-display {
        font-size: 56px;
    }

    .world-clock-grid {
        grid-template-columns: 1fr;
    }
}

/* Google Translate Overrides */
.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

body {
    top: 0px !important;
}

.goog-te-gadget {
    color: transparent !important;
}

.goog-te-gadget .goog-te-combo {
    margin: 0;
    padding: 8px;
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 16px;
    outline: none;
    cursor: pointer;
}

.goog-te-gadget .goog-te-combo:focus {
    border-color: var(--accent-1);
}