/* HIT Coach Pro - iOS-Style Web App */

:root {
    --emerald: #10b981;
    --neon-green: #22c55e;
    --dark-bg: #000000;
    --card-bg: rgba(16, 185, 129, 0.1);
    --card-border: rgba(16, 185, 129, 0.3);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --safe-area-top: env(safe-area-inset-top, 20px);
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   DESKTOP LAYOUT - Side by Side
   ============================================ */

body.desktop-layout {
    overflow: auto;
    background: linear-gradient(135deg, #0a0a0a 0%, #111 50%, #0d1f17 100%);
}

.page-wrapper {
    display: flex;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    gap: 60px;
    align-items: center;
    justify-content: center;
}

/* Left Side - App Description */
.app-description {
    flex: 1;
    max-width: 420px;
}

.description-content {
    position: sticky;
    top: 40px;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-badge-lg {
    font-size: 14px;
    font-weight: 900;
    color: #000;
    padding: 6px 10px;
    background: linear-gradient(135deg, var(--emerald), var(--neon-green));
    border-radius: 6px;
}

.app-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
}

.tagline {
    font-size: 16px;
    color: var(--emerald);
    margin-bottom: 32px;
    font-weight: 500;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    color: var(--emerald);
    flex-shrink: 0;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feature-text strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.feature-text span {
    font-size: 13px;
    color: var(--text-secondary);
}

.protocol-info {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 28px;
}

.protocol-info h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--emerald);
    margin-bottom: 8px;
}

.protocol-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cta-section {
    text-align: center;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--emerald), var(--neon-green));
    border: none;
    border-radius: 12px;
    color: #000;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.4);
}

.cta-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

.cta-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.install-btn {
    justify-content: center;
    margin-bottom: 4px;
}

.try-btn {
    background: transparent;
    border: 2px solid var(--emerald);
    color: var(--emerald);
    justify-content: center;
}

.try-btn:hover {
    background: rgba(16, 185, 129, 0.1);
}

.ios-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 4px;
}

.ios-hint svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

/* Right Side - iPhone Mockup */
.app-container {
    flex-shrink: 0;
}

.iphone-frame {
    width: 320px;
    height: 650px;
    background: #000;
    border-radius: 40px;
    border: 3px solid #333;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.1),
        0 20px 60px rgba(0,0,0,0.5),
        0 0 80px rgba(16, 185, 129, 0.15);
}

.iphone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 28px;
    background: #000;
    border-radius: 0 0 16px 16px;
    z-index: 10;
}

.iphone-notch::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 6px;
    background: #1a1a1a;
    border-radius: 3px;
}

.iphone-home-bar {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    z-index: 10;
}

.iphone-frame #app {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding-top: 35px;
    padding-bottom: 60px;
    overflow: hidden;
}

/* Mobile responsive - tablet view */
@media (max-width: 900px) {
    .page-wrapper {
        flex-direction: column;
        padding: 20px;
        gap: 30px;
    }

    .app-description {
        max-width: 100%;
        text-align: center;
    }

    .feature {
        justify-content: center;
        text-align: left;
    }

    .description-content {
        position: static;
    }
}

/* Mobile phone - FULLSCREEN APP */
@media (max-width: 500px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }

    body.desktop-layout {
        overflow: hidden;
        background: #000;
    }

    .page-wrapper {
        padding: 0;
        margin: 0;
        max-width: none;
        height: 100%;
        display: block;
    }

    .app-description {
        display: none !important;
    }

    .app-container {
        width: 100%;
        height: 100%;
    }

    .iphone-frame {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        border: none;
        box-shadow: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .iphone-notch,
    .iphone-home-bar {
        display: none;
    }

    /* App - flex column layout */
    .iphone-frame #app {
        position: absolute;
        top: var(--safe-area-top);
        left: 0;
        right: 0;
        bottom: var(--safe-area-bottom);
        display: flex;
        flex-direction: column;
        padding: 0;
    }

    /* Header - accessible touch targets */
    .header {
        padding: 8px 12px;
        flex-shrink: 0;
    }

    .header .icon-btn {
        padding: 12px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header .icon-btn svg {
        width: 22px;
        height: 22px;
    }

    .logo-badge {
        font-size: 9px;
        padding: 2px 4px;
    }

    .brand-name {
        font-size: 11px;
    }

    /* Workout picker - compact */
    .workout-picker {
        margin-bottom: 2px;
        padding: 0 12px;
        flex-shrink: 0;
    }

    .picker-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Progress bar - compact */
    .progress-bar {
        padding: 4px 12px;
        margin-bottom: 2px;
        flex-shrink: 0;
    }

    .progress-info {
        font-size: 10px;
    }

    .sync-btn, .siri-btn {
        padding: 6px 10px;
        font-size: 10px;
    }

    /* View fills remaining space */
    .view.active {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    /* Exercise list - MUST scroll */
    .exercise-list {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: scroll !important;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: auto;
        touch-action: pan-y;
        padding: 0 12px;
        padding-bottom: 100px;
    }

    /* Exercise cards - Large size for easy tapping */
    .exercise-card {
        padding: 16px 16px;
        margin-bottom: 6px;
        min-height: 60px;
        flex-shrink: 0;
    }

    .exercise-icon svg {
        width: 26px;
        height: 26px;
    }

    .exercise-icon {
        margin-right: 14px;
    }

    .exercise-name {
        font-size: 18px;
    }

    .exercise-weight {
        font-size: 14px;
    }

    .delete-btn {
        padding: 4px;
    }

    .delete-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Hide original add button, show inline one */
    .add-exercise-btn {
        display: none !important;
    }

    /* Inline add button - large touch target */
    .add-exercise-btn-inline {
        display: flex !important;
        align-items: center;
        gap: 10px;
        padding: 16px 16px;
        margin-top: 6px;
        background: rgba(16, 185, 129, 0.08);
        border: 2px dashed rgba(16, 185, 129, 0.4);
        border-radius: 12px;
        color: #fff;
        font-size: 17px;
        font-weight: 600;
        cursor: pointer;
        flex-shrink: 0;
        min-height: 60px;
    }

    .add-exercise-btn-inline svg {
        color: #10b981;
        width: 24px;
        height: 24px;
    }

    /* Tab bar - compact */
    .tab-bar {
        flex-shrink: 0;
        padding: 4px 12px 8px;
    }

    .tab {
        padding: 4px 8px;
        font-size: 9px;
    }

    .tab svg {
        width: 16px;
        height: 16px;
    }
}

/* PWA Standalone mode - same as mobile */
@media (display-mode: standalone) {
    html, body {
        height: 100%;
        overflow: hidden;
    }

    body.desktop-layout {
        overflow: hidden;
        background: #000;
    }

    .page-wrapper {
        padding: 0;
        margin: 0;
        max-width: none;
        height: 100%;
        display: block;
    }

    .app-description {
        display: none !important;
    }

    .app-container {
        width: 100%;
        height: 100%;
    }

    .iphone-frame {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        border: none;
        box-shadow: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .iphone-notch,
    .iphone-home-bar {
        display: none;
    }

    .iphone-frame #app {
        position: absolute;
        top: var(--safe-area-top);
        left: 0;
        right: 0;
        bottom: var(--safe-area-bottom);
        display: flex;
        flex-direction: column;
        padding: 0;
    }

    /* Header - accessible touch targets */
    .header {
        padding: 8px 12px;
        flex-shrink: 0;
    }

    .header .icon-btn {
        padding: 12px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header .icon-btn svg {
        width: 22px;
        height: 22px;
    }

    .logo-badge {
        font-size: 9px;
        padding: 2px 4px;
    }

    .brand-name {
        font-size: 11px;
    }

    .workout-picker {
        margin-bottom: 2px;
        padding: 0 12px;
        flex-shrink: 0;
    }

    .picker-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .progress-bar {
        padding: 4px 12px;
        margin-bottom: 2px;
        flex-shrink: 0;
    }

    .progress-info {
        font-size: 10px;
    }

    .sync-btn, .siri-btn {
        padding: 6px 10px;
        font-size: 10px;
    }

    .view.active {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    /* Exercise list - MUST scroll */
    .exercise-list {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: scroll !important;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: auto;
        touch-action: pan-y;
        padding: 0 12px;
        padding-bottom: 100px;
    }

    /* Exercise cards - Large size for easy tapping */
    .exercise-card {
        padding: 16px 16px;
        margin-bottom: 6px;
        min-height: 60px;
        flex-shrink: 0;
    }

    .exercise-icon svg {
        width: 26px;
        height: 26px;
    }

    .exercise-icon {
        margin-right: 14px;
    }

    .exercise-name {
        font-size: 18px;
    }

    .exercise-weight {
        font-size: 14px;
    }

    .delete-btn {
        padding: 4px;
    }

    .delete-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Hide original add button, show inline one */
    .add-exercise-btn {
        display: none !important;
    }

    /* Inline add button - Normal size */
    .add-exercise-btn-inline {
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        margin-top: 4px;
        background: rgba(16, 185, 129, 0.08);
        border: 1px dashed rgba(16, 185, 129, 0.4);
        border-radius: 10px;
        color: #fff;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        flex-shrink: 0;
    }

    .add-exercise-btn-inline svg {
        color: #10b981;
        width: 20px;
        height: 20px;
    }

    /* Add button - large touch target */
    .add-exercise-btn-inline {
        gap: 10px;
        padding: 16px 16px;
        margin-top: 6px;
        border-width: 2px;
        border-radius: 12px;
        font-size: 18px;
        min-height: 60px;
    }

    .add-exercise-btn-inline svg {
        width: 26px;
        height: 26px;
    }

    .tab-bar {
        flex-shrink: 0;
        padding: 4px 12px 8px;
    }

    .tab {
        padding: 4px 8px;
        font-size: 9px;
    }

    .tab svg {
        width: 16px;
        height: 16px;
    }
}

/* ============================================
   APP STYLES (Inside iPhone Frame)
   ============================================ */

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Views */
.view {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.view.active {
    display: flex;
}

/* Exercise list base - scrollable */
.exercise-list {
    flex: 1;
    min-height: 0;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-y: auto;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--dark-bg);
    position: relative;
    z-index: 10;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--emerald);
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    /* iOS WebView touch fixes */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    z-index: 5;
}

.icon-btn:active {
    background: rgba(16, 185, 129, 0.2);
}

.icon-btn svg {
    display: block;
    pointer-events: none;
}

#profile-btn {
    color: var(--neon-green);
}

/* Profile Switcher */
.profile-switcher {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px;
    border-radius: 8px;
}

.profile-toggle {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-toggle.active {
    background: var(--emerald);
    color: #000;
}

.profile-toggle:not(.active):active {
    background: rgba(255, 255, 255, 0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-badge {
    font-size: 11px;
    font-weight: 900;
    color: #000;
    padding: 3px 6px;
    background: linear-gradient(135deg, var(--emerald), var(--neon-green));
    border-radius: 4px;
}

.brand-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Workout Picker */
.workout-picker {
    display: flex;
    padding: 0 16px;
    margin-bottom: 8px;
    gap: 0;
}

.picker-btn {
    flex: 1;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.picker-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.picker-btn:last-child {
    border-radius: 0 8px 8px 0;
}

.picker-btn.active {
    background: var(--emerald);
    color: #000;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.1);
    margin-bottom: 4px;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
}

.progress-info svg {
    color: var(--neon-green);
}

.progress-bar {
    justify-content: space-between;
}

.sync-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 6px;
    color: #60a5fa;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sync-btn:active {
    background: rgba(59, 130, 246, 0.25);
}

.sync-btn svg {
    color: #60a5fa;
}

/* Exercise List - additional styles */
.exercise-list {
    padding: 0 16px;
    padding-bottom: 80px; /* Extra space at bottom for scrolling */
}

/* Add scroll buffer to ensure always scrollable */
.exercise-list::after {
    content: '';
    display: block;
    height: 60px;
    flex-shrink: 0;
}

.exercise-card {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    min-height: 52px;
    margin-bottom: 4px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.exercise-card:active {
    transform: scale(0.98);
    background: rgba(16, 185, 129, 0.2);
}

.exercise-icon {
    color: var(--emerald);
    margin-right: 12px;
}

.exercise-icon svg {
    width: 22px;
    height: 22px;
}

.exercise-info {
    flex: 1;
    min-width: 0;
}

.exercise-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exercise-weight {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.exercise-weight.has-weight {
    color: var(--neon-green);
}

.exercise-weight.no-weight {
    color: var(--text-muted);
}

.edit-weight-btn {
    background: none;
    border: none;
    color: var(--emerald);
    padding: 2px;
    cursor: pointer;
}

.exercise-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.completed-icon {
    color: var(--neon-green);
}

.chevron {
    color: var(--neon-green);
    font-size: 10px;
}

.delete-btn {
    background: none;
    border: none;
    color: rgba(239, 68, 68, 0.7);
    padding: 8px;
    cursor: pointer;
    margin-left: 4px;
}

/* Add Exercise Button */
.add-exercise-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 8px 16px 16px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px dashed var(--card-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.add-exercise-btn svg {
    color: var(--emerald);
}

.add-exercise-btn:active {
    background: rgba(16, 185, 129, 0.15);
}

/* Inline add button (rendered by JS, hidden on desktop) */
.add-exercise-btn-inline {
    display: none;
}

/* Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 6px 16px calc(env(safe-area-inset-bottom, 8px) + 8px);
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
}

.tab-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 1px;
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.tab.active {
    color: var(--neon-green);
}

.tab svg {
    transition: transform 0.2s;
}

.tab.active svg {
    transform: scale(1.1);
}

/* Timer View */
.timer-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
}

.timer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 24px;
}

.timer-header .exercise-name {
    font-size: 14px;
    color: var(--text-primary);
}

.close-btn {
    color: rgba(255, 255, 255, 0.7);
}

/* Phase Indicators */
.phase-indicators {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}

.phase-circle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s;
}

.phase-circle.active {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
}

.phase-connector {
    width: 24px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    transition: background 0.3s;
}

.phase-connector.active {
    background: var(--neon-green);
}

/* Timer Display */
.timer-display {
    font-size: 80px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
    margin-bottom: 12px;
    transition: text-shadow 0.3s;
}

.timer-display.eccentric {
    text-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
}

.timer-display.concentric {
    text-shadow: 0 0 40px rgba(34, 197, 94, 0.8);
}

/* Phase Label */
.phase-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--neon-green);
    padding: 8px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(34, 197, 94, 0.5);
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
    margin-bottom: 24px;
}

/* Timer Controls */
.timer-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: auto;
    padding-bottom: 20px;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.secondary {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-primary);
}

.control-btn.primary {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--emerald), var(--neon-green));
    border-radius: 50%;
    color: #000;
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.5);
}

/* Complete Buttons */
.complete-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    margin-top: auto;
    padding-bottom: 20px;
}

.btn-primary {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--emerald), var(--neon-green));
    border: none;
    border-radius: 12px;
    color: #000;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
    transition: transform 0.1s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-outline {
    padding: 16px 32px;
    background: transparent;
    border: 2px solid var(--emerald);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-outline:active {
    background: rgba(16, 185, 129, 0.1);
}

/* Rest Timer View */
.rest-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: linear-gradient(180deg, #0d1f17 0%, #000 100%);
}

.rest-title {
    font-size: 16px;
    color: var(--text-primary);
}

.rest-display {
    font-size: 90px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--emerald);
    text-shadow: 0 0 50px rgba(16, 185, 129, 0.5);
    margin: 30px 0 8px;
}

.rest-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.next-exercise {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 40px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    margin-bottom: auto;
}

.next-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.next-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--neon-green);
}

.rest-controls {
    padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 80px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 340px;
    background: #1a1a1a;
    border-radius: 20px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px 16px;
    text-align: center;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 12px;
}

.modal-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.modal-body {
    padding: 0 20px 20px;
}

.modal-body label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-body input[type="number"] {
    width: 100%;
    padding: 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.modal-body input[type="number"]:focus {
    border-color: var(--emerald);
}

.failure-toggle {
    margin-top: 16px;
    padding: 14px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-label input {
    width: 44px;
    height: 24px;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 12px;
    flex-shrink: 0;
}

.toggle-label input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-label input:checked {
    background: var(--neon-green);
}

.toggle-label input:checked::after {
    transform: translateX(20px);
}

.toggle-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-text svg {
    color: var(--text-muted);
    transition: color 0.2s;
}

.toggle-label input:checked + .toggle-text svg {
    color: var(--neon-green);
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
}

.btn-cancel {
    flex: 1;
    padding: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-save {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, var(--emerald), var(--neon-green));
    border: none;
    border-radius: 12px;
    color: #000;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

/* Settings Modal */
.settings-content {
    max-width: 380px;
}

.settings-body {
    padding: 0 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--emerald);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.segmented-control {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2px;
}

.seg-btn {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.seg-btn.active {
    background: var(--emerald);
    color: #000;
}

/* Voice Options Grid */
.settings-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.voice-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.voice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.voice-btn:active {
    transform: scale(0.98);
}

.voice-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--emerald);
}

.voice-btn.pro {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.05));
}

.voice-btn.pro.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(34, 197, 94, 0.15));
}

.voice-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    color: var(--emerald);
    margin-bottom: 8px;
}

.voice-btn.active .voice-icon {
    background: var(--emerald);
    color: #000;
}

.voice-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.voice-btn.active .voice-label {
    color: var(--text-primary);
}

.pro-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 8px;
    font-weight: 800;
    color: #000;
    background: linear-gradient(135deg, var(--emerald), var(--neon-green));
    padding: 2px 5px;
    border-radius: 4px;
}

.duration-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.duration-row:last-child {
    border-bottom: none;
}

.duration-row span {
    font-size: 14px;
    color: var(--text-primary);
}

.stepper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--emerald);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

.stepper span {
    min-width: 40px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Stats View */
.stats-container {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
}

.stats-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--neon-green);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-summary h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.no-data {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* Log View */
.log-container {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
}

.log-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-entry {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 12px 14px;
}

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

.log-entry-date {
    font-size: 12px;
    color: var(--text-muted);
}

.log-entry-workout {
    font-size: 12px;
    font-weight: 600;
    color: var(--emerald);
}

.log-entry-exercise {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.log-entry-details {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Profile Modal */
.text-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.text-input:focus {
    border-color: var(--emerald);
}

.text-input::placeholder {
    color: var(--text-muted);
}

.btn-danger {
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 10px;
    color: #ef4444;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:active {
    background: rgba(239, 68, 68, 0.25);
}

/* Experience Level Options */
.experience-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exp-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.exp-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--emerald);
}

.exp-icon {
    font-size: 24px;
}

.exp-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.exp-desc {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.exp-btn.active .exp-label {
    color: var(--emerald);
}

/* Routine Recommendation */
.routine-recommendation {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px;
}

.routine-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.routine-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--neon-green);
}

.routine-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Siri Setup Modal */
.siri-content {
    max-width: 380px;
}

.siri-body {
    padding: 0 20px 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.siri-instructions {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
}

.siri-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.step-num {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--emerald);
    color: #000;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.siri-section {
    margin-bottom: 16px;
}

.siri-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--emerald);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.siri-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.siri-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.siri-item-name {
    font-size: 13px;
    color: var(--text-primary);
}

.siri-copy-btn {
    padding: 6px 10px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--emerald);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

/* Voice Control Button */
.siri-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(34, 197, 94, 0.1));
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--emerald);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.siri-btn:active {
    background: rgba(16, 185, 129, 0.3);
}

.siri-btn svg {
    width: 14px;
    height: 14px;
}

/* Voice active state - listening */
.siri-btn.voice-active {
    background: linear-gradient(135deg, var(--emerald), var(--neon-green));
    color: #000;
    border-color: var(--neon-green);
    animation: voicePulse 1.5s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

/* Sync Modal */
.sync-content {
    max-width: 320px;
}

.qr-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    margin: 0 20px 16px;
}

.qr-container canvas {
    max-width: 200px;
    max-height: 200px;
}

.sync-instructions {
    padding: 0 20px 20px;
}

.sync-instructions p {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sync-instructions p:last-child {
    border-bottom: none;
}

/* Voice Hints on Timer Screen */
.voice-hints {
    margin-top: 16px;
    margin-bottom: calc(env(safe-area-inset-bottom, 20px) + 20px);
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(34, 197, 94, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    text-align: center;
    width: calc(100% - 32px);
    max-width: 300px;
}

.voice-hint-title {
    font-size: 12px;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 4px;
}

.voice-hint-commands {
    font-size: 14px;
    color: var(--text-secondary);
}

.voice-hint-commands strong {
    color: #fff;
    background: rgba(16, 185, 129, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}
