/* SafeWalk PWA Styles */
:root {
    --primary-blue: #0078D4;
    --primary-color: #4CAF50;
    --active-green: #28A745;
    --stop-red: #DC3545;
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-muted: #999999;
    --card-bg: #FFFFFF;
    --page-bg: #F5F7FA;
    --bg-secondary: #F0F0F0;
    --bg-tertiary: #E5E5E5;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-color: #E0E0E0;
    --error-bg: #FFF3CD;
    --error-border: #FFEEBA;
    --error-text: #856404;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-blue: #4DA8FF;
    --primary-color: #4CAF50;
    --active-green: #4CAF50;
    --stop-red: #FF6B6B;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --text-muted: #888888;
    --card-bg: #1E1E1E;
    --page-bg: #121212;
    --bg-secondary: #2A2A2A;
    --bg-tertiary: #333333;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --border-color: #3A3A3A;
    --error-bg: #3D3520;
    --error-border: #5C4D1A;
    --error-text: #FFD93D;
}

/* Auto Dark Mode based on system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-blue: #4DA8FF;
        --primary-color: #4CAF50;
        --active-green: #4CAF50;
        --stop-red: #FF6B6B;
        --text-primary: #FFFFFF;
        --text-secondary: #B0B0B0;
        --text-muted: #888888;
        --card-bg: #1E1E1E;
        --page-bg: #121212;
        --bg-secondary: #2A2A2A;
        --bg-tertiary: #333333;
        --shadow-color: rgba(0, 0, 0, 0.4);
        --border-color: #3A3A3A;
        --error-bg: #3D3520;
        --error-border: #5C4D1A;
        --error-text: #FFD93D;
    }
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html, body, #app {
    height: 100%;
    height: 100dvh; /* Dynamic viewport height for PWA */
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    background-color: var(--page-bg);
    /* iOS Safe Area Support */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Background Map */
.background-map {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

/* Overlay Container for UI elements */
.overlay-container {
    position: relative;
    z-index: 10;
    background: transparent;
    pointer-events: none;
}

.overlay-container > * {
    pointer-events: auto;
}

/* User marker on map */
.user-marker {
    width: 20px;
    height: 20px;
    background: var(--primary-blue);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(77, 168, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(77, 168, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(77, 168, 255, 0);
    }
}

/* Top Menu Container - unified for Home and Map */
.top-menu-container {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 15px);
    right: 15px;
    z-index: 200;
}

.top-menu-button {
    background: var(--card-bg);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 12px var(--shadow-color);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.top-menu-button:active {
    transform: scale(0.95);
}

.top-menu-button.active {
    background: var(--primary-color);
    color: white;
}

.top-menu-dropdown {
    position: absolute;
    top: 54px;
    right: 0;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-color);
    overflow: hidden;
    min-width: 180px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.menu-option:hover {
    background: var(--bg-secondary);
}

.menu-option:active {
    background: var(--bg-tertiary);
}

.menu-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.menu-text {
    flex: 1;
}

.menu-arrow {
    color: var(--text-secondary);
    font-size: 18px;
}

/* Legacy - keep for backwards compatibility */
.home-top-buttons {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 15px);
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.home-top-button {
    background: var(--card-bg);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 12px var(--shadow-color);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-top-button:active {
    transform: scale(0.95);
}

.walk-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-bottom: 120px; /* Space for fixed action button */
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for PWA */
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 4px 15px var(--shadow-color);
    width: 100%;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .status-bar {
    background: rgba(30, 30, 30, 0.9);
}

.status-private {
    border-left: 4px solid var(--primary-blue);
}

.status-tracking {
    border-left: 4px solid var(--active-green);
}

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

.status-text {
    font-weight: 600;
    color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
    padding: 16px 8px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

[data-theme="dark"] .stat-item {
    background: rgba(30, 30, 30, 0.85);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-blue);
    font-variant-numeric: tabular-nums;
}

.stat-item:first-child .stat-value {
    font-size: 20px;
    color: var(--text-primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Sensor Stats Grid (Altitude, Speed, Heading) */
.sensor-stats-grid {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.sensor-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 2px 8px var(--shadow-color);
    pointer-events: auto;
}

[data-theme="dark"] .sensor-stat-item {
    background: rgba(30, 30, 30, 0.85);
}

.sensor-icon {
    font-size: 16px;
}

.sensor-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-blue);
    font-variant-numeric: tabular-nums;
}

.sensor-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Legacy Timer Section - keeping for backwards compat */
.timer-section {
    margin-top: 40px;
    text-align: center;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

[data-theme="dark"] .timer-section {
    background: rgba(30, 30, 30, 0.85);
}

.timer-value {
    font-size: 64px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.timer-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Distance Section */
.distance-section {
    margin-top: 20px;
    text-align: center;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

[data-theme="dark"] .distance-section {
    background: rgba(30, 30, 30, 0.85);
}

.distance-value {
    font-size: 40px;
    font-weight: 700;
    color: var(--primary-blue);
}

.distance-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Profile Section */
.profile-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
    width: 100%;
}

[data-theme="dark"] .profile-section {
    background: rgba(30, 30, 30, 0.9);
}

.profile-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-options {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.profile-option {
    flex: 1;
    padding: 12px 8px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--card-bg);
}

.profile-option:hover {
    border-color: var(--primary-blue);
}

.profile-option.selected {
    border-color: var(--primary-blue);
    background: rgba(0, 120, 212, 0.1);
}

[data-theme="dark"] .profile-option.selected {
    background: rgba(77, 168, 255, 0.2);
}

.profile-option input {
    display: none;
}

.profile-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-desc {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Error Messagevar(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 8px;
    color: var(--error-text);
    width: 100%;
    text-align: center;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--primary-blue);
}

.theme-toggle:active {
    transform: scale(0.95)#FFEEBA;
    border-radius: 8px;
    color: #856404;
    width: 100%;
    text-align: center;
}

/* GPS Hint when no permission */
.gps-hint {
    margin-top: 20px;
    padding: 12px 20px;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gps-hint:hover {
    background: rgba(255, 193, 7, 0.25);
}

.gps-hint:active {
    transform: scale(0.98);
}

.gps-hint span {
    font-size: 18px;
}

/* Action Button - Fixed above bottom nav */
.action-button {
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom) + 20px);
    left: 50%;
    transform: translateX(-50%);
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    min-width: 220px;
    z-index: 50;
}

.action-button:active {
    transform: translateX(-50%) scale(0.98);
}

.start-button {
    background: var(--active-green);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.start-button:hover {
    background: #218838;
}

.stop-button {
    background: var(--stop-red);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.stop-button:hover {
    background: #c82333;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Loading */
.loading-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Responsive */
@media (max-width: 400px) {
    .timer-value {
        font-size: 56px;
    }
    
    .distance-value {
        font-size: 36px;
    }
    
    .profile-options {
        flex-direction: column;
    }
}

/* Permission Overlay (iOS style) */
.permission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.permission-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 40px var(--shadow-color);
}

.permission-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.permission-card h2 {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.permission-card p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 10px 0;
}

.permission-note {
    font-size: 13px !important;
    color: var(--active-green) !important;
    margin-bottom: 25px !important;
}

.permission-button {
    width: 100%;
    padding: 16px;
    font-size: 17px;
    font-weight: 600;
    color: white;
    background: var(--primary-blue);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.2s ease;
}

.permission-button:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.permission-error {
    margin-top: 15px;
    padding: 12px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 8px;
    color: var(--error-text);
    font-size: 14px;
}

.permission-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
    margin-bottom: 0;
}

.manual-instructions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.manual-instructions h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 0 0 10px 0;
}

.manual-instructions p {
    font-size: 14px;
    margin-bottom: 15px;
}

.manual-instructions ol {
    padding-left: 20px;
    margin: 0 0 20px 0;
}

.manual-instructions li {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 5px;
}

.manual-instructions li strong {
    color: var(--text-primary);
}

.permission-tip {
    font-size: 13px;
    color: var(--active-green);
    background: rgba(40, 167, 69, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin: 15px 0;
}

[data-theme="dark"] .permission-tip {
    background: rgba(76, 175, 80, 0.15);
}

.instruction-section {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

[data-theme="dark"] .instruction-section {
    background: rgba(255, 255, 255, 0.05);
}

.instruction-section.highlight {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

[data-theme="dark"] .instruction-section.highlight {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.3);
}

.instruction-section h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.instruction-section ol {
    margin: 0;
    padding-left: 18px;
}

.instruction-section li {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 3px;
}

.permission-button.secondary {
    background: var(--active-green);
    margin-bottom: 10px;
}

.permission-button.skip {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* iOS-specific optimizations */
@supports (-webkit-touch-callout: none) {
    /* Disable text selection on interactive elements */
    button, .profile-option {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Smoother scrolling on iOS */
    .walk-container {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent zoom on double-tap */
    button {
        touch-action: manipulation;
    }
}

/* iPhone SE / Small screens */
@media (max-height: 600px) {
    .timer-section {
        margin-top: 30px;
    }
    
    .timer-value {
        font-size: 48px;
    }
    
    .distance-section {
        margin-top: 20px;
    }
    
    .distance-value {
        font-size: 32px;
    }
    
    .profile-section {
        margin-top: 20px;
        padding: 15px;
    }
}

/* iPhone 14 Pro / Dynamic Island */
@media (min-height: 800px) {
    .walk-container {
        padding-top: 30px;
    }
}

/* Settings Button */
.settings-button {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 15px);
    right: 15px;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg);
    border: none;
    box-shadow: 0 2px 12px var(--shadow-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.settings-button:hover {
    transform: scale(1.1);
}

.settings-button svg {
    width: 24px;
    height: 24px;
    fill: var(--text-secondary);
}

/* ============================================
   SETTINGS PAGE - Touch Optimized
   ============================================ */

.settings-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--page-bg);
    padding: 20px;
    padding-top: calc(env(safe-area-inset-top) + 20px);
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.settings-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 24px 0;
}

.settings-card {
    background: var(--card-bg);
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 16px var(--shadow-color);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-content {
    padding: 16px 20px;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

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

/* Step Length Control */
.step-length-control {
    display: flex;
    align-items: center;
    gap: 16px;
}

.step-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
    outline: none;
}

.step-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.step-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.step-value {
    min-width: 60px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Status Row */
.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    margin-bottom: 12px;
}

.status-label {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Status Badge - Improved for Dark Mode */
.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.status-badge.granted {
    background: rgba(40, 167, 69, 0.2);
    color: #2ECC71;
}

.status-badge.denied {
    background: rgba(220, 53, 69, 0.2);
    color: #FF6B6B;
}

.status-badge.prompt {
    background: rgba(255, 193, 7, 0.2);
    color: #F1C40F;
}

/* Action Button */
.action-btn {
    width: 100%;
    padding: 16px 24px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn.primary {
    background: var(--primary-blue);
    color: white;
}

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

/* Toggle Row - Large Touch Target */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 8px 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-label {
    font-size: 17px;
    color: var(--text-primary);
    font-weight: 600;
}

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

/* Toggle Track - iOS Style */
.toggle-track {
    width: 56px;
    height: 32px;
    background: var(--border-color);
    border-radius: 16px;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.toggle-track.active {
    background: var(--primary-blue);
}

.toggle-thumb {
    position: absolute;
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.toggle-track.active .toggle-thumb {
    transform: translateX(24px);
}

/* Profile Grid - Large Touch Cards */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--page-bg);
    border: 2px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.profile-card.selected {
    border-color: var(--primary-blue);
    background: rgba(0, 120, 212, 0.1);
}

[data-theme="dark"] .profile-card.selected {
    background: rgba(77, 168, 255, 0.15);
}

.profile-card:active {
    transform: scale(0.96);
}

.profile-icon {
    font-size: 32px;
}

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

.profile-desc {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
}

/* Info Rows */
.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    color: var(--text-primary);
}

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

.info-value {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value.highlight {
    color: var(--primary-blue);
}

/* ============================================
   WALK ACTIVE BANNER
   ============================================ */

.walk-active-banner {
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(135deg, #28A745 0%, #20c997 100%);
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 999;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.walk-active-banner:active {
    opacity: 0.9;
}

.banner-pulse {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255, 255, 255, 0.8);
    animation: banner-pulse 1.5s infinite;
}

@keyframes banner-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.banner-content {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 20px;
    gap: 12px;
}

.banner-icon {
    font-size: 24px;
    animation: walk-bounce 0.6s infinite alternate;
}

@keyframes walk-bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-3px); }
}

.banner-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.banner-title {
    font-size: 14px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.banner-stats {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.banner-arrow {
    font-size: 28px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

/* Adjust bottom nav when banner is visible */
.app-main {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .bottom-nav {
    background: rgba(30, 30, 30, 0.95);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    min-width: 64px;
    height: 60px;
}

.nav-item.active {
    color: var(--primary-blue);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* App Main - space for bottom nav */
.app-main {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
}

/* ============================================
   FULLSCREEN MAP PAGE
   ============================================ */

.fullscreen-map {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom));
    z-index: 0;
}

.map-controls {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 15px);
    right: 15px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    z-index: 100;
}

.map-control-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg);
    border: none;
    box-shadow: 0 2px 12px var(--shadow-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
}

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

/* Layer Selector - positioned below menu dropdown */
.layer-selector {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 70px);
    right: 15px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-color);
    overflow: hidden;
    z-index: 250;
    min-width: 160px;
}

.layer-selector-header {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.layer-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.layer-option:hover {
    background: var(--bg-secondary);
}

.layer-option:active {
    background: var(--bg-tertiary);
}

.layer-option.active {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(76, 175, 80, 0.1);
}

.map-walk-info {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 15px);
    left: 15px;
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--shadow-color);
    display: flex;
    gap: 20px;
    z-index: 100;
}

.walk-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.walk-info-icon {
    font-size: 16px;
}

.walk-info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.map-history-info {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 15px);
    left: 15px;
    background: var(--card-bg);
    padding: 10px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 12px var(--shadow-color);
    font-size: 13px;
    color: var(--text-secondary);
    z-index: 100;
}

/* ============================================
   FRIENDS PAGE
   ============================================ */

.friends-container {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--page-bg);
    padding: 20px;
    padding-top: calc(env(safe-area-inset-top) + 20px);
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.friends-header {
    text-align: center;
    margin-bottom: 30px;
}

.friends-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.friends-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0;
}

.coming-soon-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow-color);
    margin-bottom: 20px;
}

.coming-soon-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.coming-soon-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px 0;
}

.coming-soon-card > p {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0 0 25px 0;
}

.feature-list {
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.feature-icon {
    font-size: 28px;
    flex-shrink: 0;
}

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

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

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

.privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(0, 120, 212, 0.1);
    padding: 15px;
    border-radius: 12px;
}

[data-theme="dark"] .privacy-note {
    background: rgba(77, 168, 255, 0.15);
}

.privacy-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.privacy-note p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.privacy-note strong {
    color: var(--primary-blue);
}

/* ============================================
   Friends Page - Live Share Styles
   ============================================ */

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

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.live-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.live-card.active {
    border: 2px solid var(--success-green);
    background: linear-gradient(135deg, 
        rgba(52, 199, 89, 0.05) 0%, 
        var(--card-bg) 100%);
}

[data-theme="dark"] .live-card.active {
    background: linear-gradient(135deg, 
        rgba(52, 199, 89, 0.1) 0%, 
        var(--card-bg) 100%);
}

.live-card.ready {
    border: 2px solid var(--primary-blue);
}

.live-card.inactive {
    opacity: 0.8;
}

.live-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    background: var(--success-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(52, 199, 89, 0);
    }
}

.status-text {
    font-weight: 600;
    color: var(--success-green);
}

.share-url-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.share-url-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-copy {
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: var(--primary-blue);
    color: white;
}

.live-actions {
    display: flex;
    gap: 12px;
}

.btn-share, .btn-stop {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-share {
    background: var(--primary-blue);
    color: white;
}

.btn-share:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
}

.btn-stop {
    background: var(--bg-secondary);
    color: var(--error-red);
}

.btn-stop:hover {
    background: var(--error-red);
    color: white;
}

.live-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.info-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.live-info p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

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

.option-row label {
    min-width: 80px;
    font-size: 14px;
    color: var(--text-secondary);
}

.input-name, .select-duration {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 15px;
}

.input-name:focus, .select-duration:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.btn-start-share {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-blue), #34C759);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-start-share:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
}

.btn-start-share:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-goto-home {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--primary-blue);
    border-radius: 12px;
    background: transparent;
    color: var(--primary-blue);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-goto-home:hover {
    background: var(--primary-blue);
    color: white;
}

.error-message {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid var(--error-red);
    border-radius: 10px;
    color: var(--error-red);
    font-size: 14px;
}

.security-card {
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.08) 0%, 
        rgba(52, 199, 89, 0.08) 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

[data-theme="dark"] .security-card {
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.15) 0%, 
        rgba(52, 199, 89, 0.15) 100%);
}

.security-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.security-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.security-item span:first-child {
    font-size: 18px;
}

/* ============================================
   History Page Styles
   ============================================ */

.walk-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.walk-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.walk-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--primary-color);
    border-radius: 12px;
    flex-shrink: 0;
}

.date-day {
    font-size: 20px;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.date-month {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
}

.walk-details {
    flex: 1;
    min-width: 0;
}

.walk-time {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.walk-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 4px;
}

.walk-stats .stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.walk-stats .stat-icon {
    font-size: 12px;
}

.walk-points {
    font-size: 11px;
    color: var(--text-muted);
}

.walk-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

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

.action-btn.danger:hover {
    background: rgba(244, 67, 54, 0.1);
}

.export-all-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.export-all-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   MAP MODAL - History Walk View
   ============================================ */

.map-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.map-modal {
    background: var(--card-bg);
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.map-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.map-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: background 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--bg-tertiary);
}

.map-modal-stats {
    display: flex;
    gap: 20px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    font-size: 14px;
    color: var(--text-secondary);
}

.map-modal-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-modal-content {
    height: 400px;
    min-height: 300px;
}

/* Mobile adjustments */
@media (max-height: 700px) {
    .map-modal-content {
        height: 280px;
    }
}

/* ===========================================
   LIVE SHARE STYLES
   =========================================== */

/* Share Modal */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.share-modal {
    background: var(--card-bg);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.share-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 50%;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-secondary);
}

.share-modal-content {
    padding: 20px;
}

.share-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.5;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.share-option-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.share-name-input,
.share-duration-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 16px;
}

.share-name-input:focus,
.share-duration-select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.share-active {
    text-align: center;
}

.share-status {
    font-size: 16px;
    font-weight: 600;
    color: var(--stop-red);
    margin-bottom: 16px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.share-url-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.share-url-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.copy-btn:hover {
    background: var(--bg-tertiary);
}

.share-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.share-actions .action-btn {
    flex: 1;
}

.action-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.action-btn.full-width {
    width: 100%;
}

.share-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin: 12px 0 0;
}

/* Menu active state for live share */
.menu-option.active {
    background: rgba(220, 53, 69, 0.1);
}

.menu-option.active .menu-icon {
    animation: pulse 1.5s infinite;
}

/* ===========================================
   WATCH PAGE STYLES
   =========================================== */

.watch-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top));
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .watch-header {
    background: rgba(30, 30, 30, 0.9);
}

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

.watch-status {
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
}

.watch-status.connected {
    background: rgba(40, 167, 69, 0.15);
    color: var(--active-green);
}

.watch-status.connecting {
    background: rgba(255, 193, 7, 0.15);
    color: #FFC107;
}

.watch-status.ended {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.watch-status.error {
    background: rgba(220, 53, 69, 0.15);
    color: var(--stop-red);
}

.watch-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.watch-stats {
    display: flex;
    gap: 16px;
}

.watch-stat {
    font-size: 14px;
    color: var(--text-secondary);
}

.watch-error {
    position: fixed;
    top: 80px;
    left: 20px;
    right: 20px;
    padding: 12px 16px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 12px;
    color: var(--error-text);
    font-size: 14px;
    z-index: 100;
}

.watch-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
    z-index: 100;
}

[data-theme="dark"] .watch-footer {
    background: rgba(30, 30, 30, 0.9);
}

.update-time {
    font-size: 12px;
    color: var(--text-muted);
}

.watch-ended-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.watch-ended-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.ended-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.watch-ended-card h2 {
    margin: 0 0 12px;
    color: var(--text-primary);
}

.watch-ended-card p {
    margin: 0 0 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   Walk End Dialog Styles
   ============================================ */

.walk-end-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
}

.walk-end-modal {
    background: var(--card-bg);
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.walk-end-header {
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.walk-end-header h2 {
    margin: 0 0 12px;
    font-size: 24px;
    color: var(--text-primary);
}

.walk-end-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 15px;
}

.walk-end-content {
    padding: 20px 24px;
}

.counters-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.counter-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.counter-card .counter-emoji {
    font-size: 32px;
}

.counter-card .counter-name {
    font-size: 13px;
    color: var(--text-secondary);
}

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

.btn-counter {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-counter.minus {
    background: var(--bg-tertiary, #e5e5e5);
    color: var(--text-secondary);
}

.btn-counter.plus {
    background: var(--primary-blue);
    color: white;
}

.btn-counter:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-counter.minus:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-counter.plus:hover:not(:disabled) {
    background: var(--primary-blue-dark);
    transform: scale(1.05);
}

.counter-value {
    font-size: 24px;
    font-weight: 700;
    min-width: 32px;
    color: var(--text-primary);
}

.rating-section {
    margin-bottom: 20px;
    text-align: center;
}

.rating-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.star-rating {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.star-rating .star {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    filter: grayscale(100%);
    opacity: 0.4;
    transition: all 0.2s ease;
}

.star-rating .star.filled {
    filter: grayscale(0%);
    opacity: 1;
}

.star-rating .star:hover {
    transform: scale(1.2);
}

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

.notes-input {
    width: 100%;
    min-height: 80px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
}

.notes-input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

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

.walk-end-actions {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border-color);
}

.btn-skip {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-skip:hover {
    background: var(--bg-secondary);
}

.btn-save {
    flex: 2;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-blue), #34C759);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
}

/* ============================================
   Settings - Walk End Counter Styles
   ============================================ */

.counters-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.counters-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 12px;
}

.counter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.counter-row:last-of-type {
    border-bottom: none;
}

.counter-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.counter-row .counter-emoji {
    font-size: 20px;
}

.counter-row .counter-label {
    font-size: 15px;
    color: var(--text-primary);
}

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

.toggle-track.small {
    width: 40px;
    height: 24px;
}

.toggle-track.small .toggle-thumb {
    width: 18px;
    height: 18px;
    top: 3px;
    left: 3px;
}

.toggle-track.small.active .toggle-thumb {
    left: 19px;
}

.btn-delete-counter {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-delete-counter:hover {
    opacity: 1;
}

.add-counter-form {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    align-items: center;
}

.input-emoji {
    width: 50px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 18px;
    text-align: center;
}

.input-label {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.btn-add, .btn-cancel {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add {
    background: var(--success-green);
    color: white;
}

.btn-cancel {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.btn-add-counter {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: transparent;
    color: var(--primary-blue);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s ease;
}

.btn-add-counter:hover {
    border-color: var(--primary-blue);
    background: rgba(0, 122, 255, 0.05);
}
