/**
 * Glassmorphism UI System
 * Premium dark theme with blue accents
 * For Arbeitszeit Helden
 */

/* ============================================
   GRADIENT TEXT MIXINS
   ============================================ */

/* Light gradient for dark backgrounds */
.gradient-text-light {
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dark gradient for light backgrounds */
.gradient-text-dark {
    background: linear-gradient(135deg, #1e293b, #1e88e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   GRADIENT BORDERS - ALL ELEMENTS
   ============================================ */

/* Gradient border utility - using pseudo-element technique */
.gradient-border {
    position: relative;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 16px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Apply gradient border to all bordered elements */
.ah-glass-panel,
.timer-panel,
.calculator-panel,
.ah-header,
.ah-footer-section,
.ah-footer-badges,
.ah-footer-badge,
.ah-footer-contact,
.ah-footer-legal,
.ah-footer-bottom,
.ah-footer-bottom-links a,
.modal-content,
.tab-navigation,
.tab-navigation button,
.history-calendar,
.history-day-detail,
.lap-list,
.rechenweg,
.settings-group,
.stat-item,
.calendar-day,
.input-group input,
.input-group select,
.countdown-input-group input,
input[type="date"],
.time-selects select {
    border: 1px solid transparent;
    background-image: linear-gradient(rgba(30, 41, 59, 0.6), rgba(30, 41, 59, 0.6)), linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(148, 163, 184, 0.5));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

/* Navigation items with gradient border */
.ah-nav-item {
    border: 1px solid transparent;
    background-image: linear-gradient(rgba(30, 136, 229, 0.1), rgba(30, 136, 229, 0.1)), linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(148, 163, 184, 0.4));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.ah-nav-item:hover {
    background-image: linear-gradient(rgba(30, 136, 229, 0.2), rgba(30, 136, 229, 0.2)), linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(148, 163, 184, 0.6));
}

/* ============================================
   GRADIENT BUTTON TEXT - ALL BUTTONS
   ============================================ */

/* Primary buttons - blue gradient background, WHITE TEXT */
.btn-primary,
.timer-controls .btn-primary,
button.btn-primary,
#pomodoro-start,
#pomodoro-pause {
    background: linear-gradient(135deg, #1e88e5, #42a5f5) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.4) !important;
}

.btn-primary:hover,
.timer-controls .btn-primary:hover,
#pomodoro-start:hover,
#pomodoro-pause:hover {
    background: linear-gradient(135deg, #42a5f5, #64b5f6) !important;
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.5) !important;
    transform: translateY(-2px);
}

/* Calculate button - DARK BLUE gradient, white text, shadow */
.btn-calculate {
    background: linear-gradient(135deg, #1e3a5f, #1e88e5) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.5) !important;
}

.btn-calculate:hover {
    background: linear-gradient(135deg, #1e88e5, #2563eb) !important;
    box-shadow: 0 8px 25px rgba(30, 136, 229, 0.6) !important;
    transform: translateY(-2px);
}

/* Secondary/Settings buttons - visible white text */
.btn-secondary,
.btn-settings,
.btn-mode-toggle,
.btn-share,
.timer-controls .btn-secondary,
#pomodoro-stop,
#pomodoro-reset,
#pomodoro-settings {
    background-color: rgba(30, 136, 229, 0.2) !important;
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.btn-secondary:hover,
.btn-settings:hover,
.btn-mode-toggle:hover,
.btn-share:hover,
.timer-controls .btn-secondary:hover,
#pomodoro-stop:hover,
#pomodoro-reset:hover,
#pomodoro-settings:hover {
    background-color: rgba(30, 136, 229, 0.35) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-2px);
}

/* Tab navigation buttons - visible text */
.tab-navigation button:not([aria-selected="true"]) {
    background-color: rgba(30, 41, 59, 0.5) !important;
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.tab-navigation button:not([aria-selected="true"]):hover {
    background-color: rgba(30, 136, 229, 0.3) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Active tab - solid gradient background, white text */
.tab-navigation button[aria-selected="true"] {
    background: linear-gradient(135deg, #1e88e5, #42a5f5) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: none !important;
}

/* Timer display - gradient text */
.timer-display {
    background: linear-gradient(135deg, #ffffff, #94a3b8) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

/* Header toggle button */
.ah-header-toggle {
    background-color: rgba(30, 136, 229, 0.15) !important;
    background-image: linear-gradient(135deg, #ffffff, #94a3b8) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ah-header-toggle:hover {
    background-color: rgba(30, 136, 229, 0.25) !important;
}

/* ============================================
   MAIN CONTENT CONTAINER - Match Header/Footer Width
   ============================================ */

main.container,
main .container,
.ah-main-content,
.container {
    max-width: 1200px !important;
    margin: 0 auto;
    padding: 0 20px;
}

/* Ensure all panels and sections align with header/footer */
.timer-panel,
.calculator-panel,
.ah-glass-panel,
.hero-section,
.calculator-cards,
.cards-grid,
.rechenweg-container,
.result-container,
.history-calendar,
.settings-group,
.modal-content,
.tab-navigation,
.section-separator,
.history-header {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Individual panels can be narrower for better readability */
.timer-panel {
    max-width: 500px;
}

.calculator-panel {
    max-width: 550px;
}

.modal-content {
    max-width: 450px;
}

/* ============================================
   DARK BODY BACKGROUND
   ============================================ */

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg,
        #0a1628 0%,
        #0f172a 25%,
        #1e293b 50%,
        #0f172a 75%,
        #0a1628 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   GRADIENT TEXT ON DARK BACKGROUNDS
   ============================================ */

/* Apply gradient text to all text elements on dark backgrounds */
.ah-header h1,
.ah-header h2,
.ah-header h3,
.ah-header p,
.ah-header span:not(.ah-header-logo),
.ah-header a,
.ah-glass-panel h1,
.ah-glass-panel h2,
.ah-glass-panel h3,
.ah-glass-panel h4,
.ah-glass-panel p,
.ah-glass-panel span,
.ah-glass-panel label,
.ah-glass-panel a,
.timer-panel h1,
.timer-panel h2,
.timer-panel h3,
.timer-panel p,
.timer-panel span,
.timer-panel label,
.timer-display,
.timer-phase,
.calculator-panel h1,
.calculator-panel h2,
.calculator-panel h3,
.calculator-panel p,
.calculator-panel span,
.calculator-panel label,
.rechenweg-label,
.rechenweg-value,
.rechenweg-step,
.lap-item,
.lap-number,
.stat-item .stat-label,
.stat-item .stat-value,
.history-calendar h1,
.history-calendar h2,
.history-calendar h3,
.history-calendar p,
.history-calendar label,
.calendar-day,
.settings-group h1,
.settings-group h2,
.settings-group h3,
.settings-group p,
.settings-group label,
.settings-group span,
.modal-content h1,
.modal-content h2,
.modal-content h3,
.modal-content h4,
.modal-content p,
.modal-content label,
.modal-content span,
.input-group label,
.countdown-input-group label {
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons with visible text (not gradient) */
.tab-navigation button:not([aria-selected="true"]),
.ah-nav-item:not(.active) {
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tab buttons and nav items preserve their original styling for non-active states */
.tab-navigation button:not([aria-selected="true"]):hover,
.ah-nav-item:not(.active):hover {
    background: rgba(30, 136, 229, 0.2);
    border-color: rgba(30, 136, 229, 0.4);
    -webkit-text-fill-color: initial;
    color: #ffffff;
}

/* Animated background particles effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(30, 136, 229, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(30, 136, 229, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   GLASSMORPHISM HEADER
   ============================================ */

header.ah-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(30, 136, 229, 0.2);
    padding: 0;
    text-align: left;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

header.ah-header h1 {
    margin-bottom: 0;
}

.ah-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.ah-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 15px 0;
}

.ah-header-logo {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #d5e7f6, #75a2c7);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Premium SVG Logo Styling */
.ah-logo-svg {
    width: 46px;
    height: 46px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ah-header-logo:hover .ah-logo-svg {
    transform: rotate(5deg) scale(1.1);
}

.ah-header-logo:hover {
    transform: scale(1.05) rotate(3deg);
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.5);
}

/* Logo SVG pulse animation */
@keyframes ahLogoPulse {
    0%, 100% {
        filter: drop-shadow(0 0 0 rgba(54, 185, 235, 0));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(54, 185, 235, 0.5));
    }
}

.ah-header-logo:hover .ah-logo-svg {
    animation: ahLogoPulse 2s ease-in-out infinite;
}

.ah-header-title {
    display: flex;
    flex-direction: column;
}

.ah-header-title h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ah-header-tagline {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: -2px;
}

/* Header Navigation */
.ah-header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.ah-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(30, 136, 229, 0.1);
    border: 1px solid rgba(30, 136, 229, 0.2);
    border-radius: 8px;
    color: #94a3b8;
    -webkit-text-fill-color: currentColor;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.15s ease,
                -webkit-text-fill-color 0.15s ease,
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.ah-nav-item:hover {
    background: rgba(30, 136, 229, 0.2);
    border-color: rgba(30, 136, 229, 0.4);
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.2);
}

.ah-nav-item.active {
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    border-color: transparent;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.4);
}

.ah-nav-item .nav-icon {
    font-size: 1rem;
}

/* ============================================
   DROPDOWN NAVIGATION
   ============================================ */

/* Dropdown wrapper */
.ah-nav-dropdown {
    position: relative;
}

.ah-nav-dropdown > .ah-nav-item {
    cursor: pointer;
    padding-right: 32px;
}

.ah-nav-dropdown > .ah-nav-item::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #94a3b8;
    transition: transform 0.2s ease;
    pointer-events: none;
}

.ah-nav-dropdown:hover > .ah-nav-item::after,
.ah-nav-dropdown.open > .ah-nav-item::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Dropdown menu */
.ah-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    margin-top: 8px;
    padding: 8px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(30, 136, 229, 0.25);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(30, 136, 229, 0.08);
    z-index: 1001;
}

.ah-nav-dropdown:hover > .ah-dropdown-menu,
.ah-nav-dropdown.open > .ah-dropdown-menu {
    display: block;
}

.ah-dropdown-menu .ah-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: #94a3b8;
    -webkit-text-fill-color: currentColor;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.2s ease,
                color 0.15s ease,
                -webkit-text-fill-color 0.15s ease;
    white-space: nowrap;
}

.ah-dropdown-menu .ah-dropdown-item:hover {
    background: rgba(30, 136, 229, 0.2);
    color: #e2e8f0;
    -webkit-text-fill-color: #e2e8f0;
}

.ah-dropdown-menu .ah-dropdown-item.active {
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

/* Active dropdown parent highlight */
.ah-nav-dropdown.active-parent > .ah-nav-item {
    background: rgba(30, 136, 229, 0.2);
    color: #e2e8f0;
    -webkit-text-fill-color: #e2e8f0;
}

/* Mobile dropdown behavior */
@media (max-width: 900px) {
    .ah-nav-dropdown > .ah-nav-item::after {
        right: 16px;
    }

    .ah-dropdown-menu {
        display: none;
        position: static;
        min-width: 100%;
        margin-top: 4px;
        margin-left: 12px;
        padding: 6px;
        background: rgba(15, 23, 42, 0.6);
        border: 1px solid rgba(30, 136, 229, 0.15);
    }

    .ah-nav-dropdown.open > .ah-dropdown-menu {
        display: block;
    }

    .ah-dropdown-menu .ah-dropdown-item {
        justify-content: center;
    }
}

/* Header scroll effect */
.ah-header.scrolled {
    background: rgba(10, 22, 40, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 0 40px rgba(30, 136, 229, 0.1);
    border-bottom-color: rgba(30, 136, 229, 0.35);
}

.ah-header.scrolled .ah-header-logo {
    box-shadow: 0 2px 10px rgba(30, 136, 229, 0.5);
}

.ah-header.scrolled .ah-nav-item {
    padding: 6px 12px;
    font-size: 0.82rem;
}

/* Mobile Menu Toggle */
.ah-header-toggle {
    display: none;
    background: rgba(30, 136, 229, 0.15);
    border: 1px solid rgba(30, 136, 229, 0.25);
    border-radius: 8px;
    padding: 10px 12px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ah-header-toggle:hover {
    background: rgba(30, 136, 229, 0.25);
    color: #ffffff;
}

/* ============================================
   GLASSMORPHISM PANELS
   ============================================ */

.ah-glass-panel {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(30, 136, 229, 0.15);
    border-radius: 16px;
    padding: 24px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ah-glass-panel:hover {
    border-color: rgba(30, 136, 229, 0.25);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(30, 136, 229, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Timer Panel Specific */
.timer-panel {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(30, 136, 229, 0.15);
    border-radius: 20px;
    padding: 30px;
    margin: 20px auto;
    max-width: 500px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Calculator Panel */
.calculator-panel {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(30, 136, 229, 0.15);
    border-radius: 20px;
    padding: 30px;
    margin: 20px auto;
    max-width: 550px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ============================================
   GLASSMORPHISM TABS
   ============================================ */

.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    padding: 8px;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    border: 1px solid rgba(30, 136, 229, 0.1);
}

.tab-navigation button {
    padding: 12px 20px;
    background: rgba(30, 136, 229, 0.1);
    border: 1px solid rgba(30, 136, 229, 0.2);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.tab-navigation button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.tab-navigation button:hover:not(:disabled)::before {
    left: 100%;
}

.tab-navigation button:hover:not(:disabled) {
    background: rgba(30, 136, 229, 0.2);
    border-color: rgba(30, 136, 229, 0.4);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.2);
}

.tab-navigation button[aria-selected="true"] {
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 20px rgba(30, 136, 229, 0.4);
}

.tab-navigation button[aria-selected="true"]::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1px;
}

.tab-navigation button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   GLASSMORPHISM BUTTONS
   ============================================ */

/* Primary Button */
.btn-primary,
.timer-controls .btn-primary {
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.timer-controls .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover:not(:disabled),
.timer-controls .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(30, 136, 229, 0.5);
    background: linear-gradient(135deg, #42a5f5, #64b5f6);
}

.btn-primary:hover:not(:disabled)::before,
.timer-controls .btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary:active:not(:disabled),
.timer-controls .btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled,
.timer-controls .btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Secondary Button */
.btn-secondary,
.timer-controls .btn-secondary {
    background: rgba(30, 136, 229, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(30, 136, 229, 0.25);
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover:not(:disabled),
.timer-controls .btn-secondary:hover:not(:disabled) {
    background: rgba(30, 136, 229, 0.25);
    border-color: rgba(30, 136, 229, 0.4);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.2);
}

.btn-secondary:disabled,
.timer-controls .btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-calculate:active {
    transform: translateY(0) scale(0.98);
}

/* Settings Button */
.btn-settings {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-settings:hover:not(:disabled) {
    background: rgba(100, 116, 139, 0.3);
    border-color: rgba(100, 116, 139, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Mode Toggle */
.btn-mode-toggle {
    background: rgba(30, 136, 229, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(30, 136, 229, 0.2);
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-mode-toggle:hover {
    background: rgba(30, 136, 229, 0.2);
    border-color: rgba(30, 136, 229, 0.4);
    color: #ffffff;
}

/* ============================================
   GLASSMORPHISM INPUTS
   ============================================ */

.input-group label {
    color: #94a3b8;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.input-group input,
.input-group select,
.countdown-input-group input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(30, 136, 229, 0.2);
    border-radius: 10px;
    padding: 14px 16px;
    color: #e2e8f0;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.input-group input:focus,
.input-group select:focus,
.countdown-input-group input:focus {
    outline: none;
    border-color: rgba(30, 136, 229, 0.5);
    box-shadow: 0 0 20px rgba(30, 136, 229, 0.2);
    background: rgba(15, 23, 42, 0.8);
}

.input-group input::placeholder {
    color: #64748b;
}

/* Dropdown styling */
.input-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Time Selects */
.time-selects select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(30, 136, 229, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    color: #e2e8f0;
    font-size: 1rem;
}

/* Date Input */
input[type="date"] {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(30, 136, 229, 0.2);
    border-radius: 10px;
    padding: 14px 16px;
    color: #e2e8f0;
    cursor: pointer;
}

input[type="date"]:focus {
    border-color: rgba(30, 136, 229, 0.5);
    box-shadow: 0 0 20px rgba(30, 136, 229, 0.2);
}

/* Range Input */
input[type="range"] {
    -webkit-appearance: none;
    background: rgba(30, 136, 229, 0.2);
    border-radius: 10px;
    height: 8px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(30, 136, 229, 0.4);
}

/* Checkbox */
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #1e88e5;
    cursor: pointer;
}

/* ============================================
   TIMER DISPLAY
   ============================================ */

.timer-display {
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-size: 5rem;
    font-weight: bold;
    text-align: center;
    margin: 2rem 0;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.timer-phase {
    font-size: 1.2rem;
    color: #1e88e5;
    margin-bottom: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ============================================
   RESULTS & RECHENWEG
   ============================================ */

.rechenweg {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(30, 136, 229, 0.15);
    border-radius: 12px;
    padding: 20px;
}

.rechenweg-step {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(30, 136, 229, 0.1);
    color: #94a3b8;
}

.rechenweg-step:last-of-type {
    border-bottom: none;
}

.rechenweg-label {
    color: #64748b;
}

.rechenweg-value {
    font-weight: 600;
    color: #e2e8f0;
}

.rechenweg-result {
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
    margin-top: 10px;
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.3);
}

.result-highlight {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    color: white;
    padding: 20px 40px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(30, 136, 229, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-value {
    font-size: 2.5rem;
    font-weight: bold;
    font-family: 'JetBrains Mono', monospace;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.result-unit {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 4px;
}

/* ============================================
   HISTORY & CALENDAR
   ============================================ */

.history-calendar {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(30, 136, 229, 0.15);
    border-radius: 16px;
    padding: 20px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: #64748b;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid rgba(30, 136, 229, 0.1);
    color: #94a3b8;
}

.calendar-day:hover {
    background: rgba(30, 136, 229, 0.2);
    border-color: rgba(30, 136, 229, 0.3);
    color: #ffffff;
    transform: scale(1.05);
}

.calendar-day.today {
    border: 2px solid #1e88e5;
    box-shadow: 0 0 15px rgba(30, 136, 229, 0.3);
}

.calendar-day.selected {
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
    color: white;
    border-color: transparent;
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(30, 136, 229, 0.15);
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e88e5;
    text-shadow: 0 0 20px rgba(30, 136, 229, 0.3);
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
}

/* ============================================
   SETTINGS & MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(30, 136, 229, 0.2);
    padding: 30px;
    border-radius: 20px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #e2e8f0;
    font-size: 1.3rem;
}

.settings-group {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(30, 136, 229, 0.1);
}

.setting-item:last-child {
    border-bottom: none;
}

.settings-section-title {
    font-size: 1rem;
    margin-top: 20px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(30, 136, 229, 0.2);
    color: #1e88e5;
    font-weight: 600;
}

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

@media (max-width: 900px) {
    .ah-header-toggle {
        display: block;
    }

    .ah-header-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-bottom: 10px;
    }

    .ah-header-nav.active {
        display: flex;
    }

    .ah-header-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .ah-nav-item {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .ah-header-title h1 {
        font-size: 1.1rem;
    }

    .ah-header-tagline {
        display: none;
    }

    .timer-display {
        font-size: 3rem;
        padding: 15px;
    }

    .tab-navigation {
        gap: 4px;
        padding: 6px;
    }

    .tab-navigation button{
        padding: 12px 16px;
        font-size: 0.85rem;
        min-height: 48px; /* TOUCH TARGET FIX */
    }

    .timer-controls {
        flex-direction: column;
        gap: 8px;
    }

    .timer-controls button{
        width: 100%;
        min-height: 48px; /* TOUCH TARGET FIX */
        padding: 12px 20px;
    }

    .calculator-panel,
    .timer-panel {
        padding: 20px;
        margin: 15px 10px;
    }

    .btn-calculate {
        padding: 14px 24px;
        font-size: 1rem;
        min-height: 48px; /* TOUCH TARGET FIX */
    }

    .history-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .result-value {
        font-size: 2rem;
    }

    .result-highlight {
        padding: 15px 25px;
    }

    /* Touch target enforcement for all interactive elements */
    .btn-primary,
    .btn-secondary,
    .btn-settings,
    .btn-mode-toggle,
    .btn-share {
        min-height: 48px;
        min-width: 48px;
    }

    .ah-nav-item {
        min-height: 48px;
        padding: 12px 16px;
    }

    .input-group input,
    .input-group select {
        min-height: 48px;
    }

    .ah-footer-social a {
        width: 48px;
        height: 48px;
    }

    .ah-footer-links a {
        display: block;
        padding: 12px 0;
        min-height: 48px;
    }

    .ah-footer-bottom-links a {
        min-height: 48px;
        display: inline-flex;
        align-items: center;
    }

    .calendar-day {
        min-height: 40px; /* Calendar cells slightly smaller but still tappable */
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(30, 136, 229, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(30, 136, 229, 0.5);
    }
}

.timer-display.running {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Lap List */
.lap-list {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(30, 136, 229, 0.15);
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.lap-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(30, 136, 229, 0.1);
    color: #94a3b8;
}

.lap-item:last-child {
    border-bottom: none;
}

.lap-number {
    color: #1e88e5;
    font-weight: 600;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-share {
    background: rgba(30, 136, 229, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(30, 136, 229, 0.25);
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-share:hover {
    background: rgba(30, 136, 229, 0.25);
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-share.copied {
    background: linear-gradient(135deg, #10b981, #34d399);
    border-color: transparent;
    color: white;
}

/* Error States */
.rechenweg-error {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 16px;
    border-radius: 12px;
}

.error-message {
    color: #f87171;
    font-size: 0.875rem;
}

/* ============================================
   TOUCH TARGET BASELINE (all viewports)
   WCAG 2.1 / Google minimum: 48x48px
   ============================================ */

button,
.btn-primary,
.btn-secondary,
.btn-settings,
.btn-calculate,
.btn-share,
.btn-mode-toggle,
.tab-navigation button,
.ah-nav-item,
.pg-nav-item,
input[type="submit"],
input[type="button"],
input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
select,
[role="button"] {
    min-height: 44px;
}

table,
table:not([role]),
table:not([class]) {
    background: rgba(30, 41, 59, 0.5) !important;
    border-collapse: collapse !important;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(30, 136, 229, 0.15) !important;
    color: #cbd5e1 !important;
}

thead {
    background: rgba(15, 23, 42, 0.7) !important;
}

th,
table th,
thead th {
    background: rgba(15, 23, 42, 0.7) !important;
    color: #e2e8f0 !important;
    font-weight: 600 !important;
    font-size: 0.9rem;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid rgba(30, 136, 229, 0.3) !important;
}

td,
table td,
tbody td {
    background: rgba(30, 41, 59, 0.3) !important;
    color: #cbd5e1 !important;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(30, 136, 229, 0.1) !important;
    font-size: 0.9rem;
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover,
tbody tr:nth-child(even) {
    background: rgba(30, 136, 229, 0.08) !important;
}

tbody tr:hover td {
    background: rgba(30, 136, 229, 0.12) !important;
}

tbody tr:last-child td {
    border-bottom: none !important;
}
