:root {
    --navy-blue: #1a2b66;
    --papyrus-gold: #f5e6d3;
    --papyrus-light: #faf3e8;
    --papyrus-medium: #f0ddc0;
    --green-grade: #5a9a42; /* Darkened from #71B956 for better contrast (3.57:1) */
    --orange-grade: #E67234;
    --red-grade: #D63B3B;
    --inactive-nav-color: #6e6e73; /* Darkened from #8e8e93 for 4.54:1 contrast */
    --header-height: 60px;
    --bottom-nav-height: 70px;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 16px; /* Standardize base font size */
    line-height: 1.5; /* Consistent line height */
    background: #f5f5f7;
    min-height: 100vh;
    overflow-x: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Skip to main content link - accessible hidden by default */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--navy-blue);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #f5e6d3;
    outline-offset: 2px;
}

/* Fixed Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--header-height) + var(--safe-area-top));
    padding-top: var(--safe-area-top);
    background: var(--navy-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 15px;
    padding-right: 15px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.app-logo {
    height: 32px;
    width: auto;
}

.app-brand {
    font-size: 22px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* GPS Status Badge */
.gps-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 8px;
}

.gps-badge.acquiring {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
    animation: pulse-gps 1.5s infinite;
}

.gps-badge.locked {
    background: rgba(113, 185, 86, 0.2);
    color: #71B956;
}

.gps-badge.error {
    background: rgba(214, 59, 59, 0.2);
    color: #D63B3B;
}

.gps-timer {
    font-size: 10px;
    opacity: 0.8;
    margin-left: 4px;
}

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

/* Network Status Badge */
.network-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.network-badge.online {
    background: rgba(113, 185, 86, 0.2);
    color: #71B956;
}

.network-badge.offline {
    background: rgba(214, 59, 59, 0.2);
    color: #D63B3B;
    animation: pulse-badge 2s infinite;
}

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

/* Notification Bell */
.notification-bell {
    position: relative;
    background: rgba(255,255,255,0.1);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    color: white;
    padding: 0;
}

.notification-bell:hover {
    background: rgba(255,255,255,0.15);
}

.notification-bell:focus {
    outline: 2px solid #f5e6d3;
    outline-offset: 2px;
    background: rgba(255,255,255,0.2);
}

.notification-bell:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.2);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #D63B3B;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--navy-blue);
}

/* Main Content Area */
.app-content {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-area-top));
    left: 0;
    right: 0;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: #f5f5f7;
}

/* Tab Content */
.tab-content {
    display: none;
    min-height: 100%;
    padding-bottom: 20px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: white;
    display: flex; /* Always visible on all tabs */
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

/* Hide nav during recording/review flows to keep user focused */
.bottom-nav.hidden-for-flow {
    display: none; /* Completely remove from layout during video flows - no empty white space */
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--inactive-nav-color);
    background: none;
    border: none;
    font-family: inherit;
}

.nav-item:hover:not(.active) {
    background: rgba(0,0,0,0.05);
}

.nav-item:focus {
    outline: 2px solid var(--navy-blue);
    outline-offset: -2px;
}

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

.nav-item i {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-size: 24px;
    margin-bottom: 4px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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

.nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(20px);
    background: #D63B3B;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Session Banner */
.session-banner {
    padding: 10px 20px 8px 20px; /* Consistent 20px side margins, tight vertical spacing */
}

.session-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0; /* Remove bottom margin for tighter spacing */
}

.session-banner-info h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 2px; /* Reduced from 4px */
    font-weight: 500;
}

.session-banner-info .address {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy-blue);
    margin-bottom: 0; /* Tighter spacing to timestamp */
    line-height: 1.3;
}

.session-banner-time {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 0; /* Remove top margin, controlled by address margin-bottom */
}

.btn-end-session {
    background: rgba(214, 59, 59, 0.1);
    color: #D63B3B;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
}

/* Session Setup */
.session-setup {
    padding: 0; /* No padding - session-card margins handle spacing */
}

.session-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 0 20px 20px 20px; /* 20px side margins to match notification, 20px bottom, 0 top */
    margin-top: 30px; /* Gap between notification and module - matches gap above notification */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.session-card h2 {
    color: var(--navy-blue);
    font-size: 20px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.session-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Input Groups */
.input-group {
    margin-bottom: 15px;
}

.input-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e5e5ea;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: 2px solid var(--navy-blue);
    outline-offset: 0;
    border-color: var(--navy-blue);
    background: #fafafa;
}

/* Autocomplete */
.autocomplete-container {
    position: relative;
}

.autocomplete-container input {
    width: 100%;
    padding-right: 48px; /* Make room for button */
}

/* Subtle Location Button - Inside input field */
.btn-location-subtle {
    position: absolute;
    right: 8px;
    top: 8px;
    background: transparent;
    color: #6b7280;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 10;
    /* Prevent tap highlight on mobile Safari */
    -webkit-tap-highlight-color: transparent;
    /* Fix for iOS Safari - prevent button jump on tap */
    touch-action: manipulation;
    /* Prevent any browser default button styles */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Lock positioning */
    transform: translateZ(0); /* GPU acceleration to lock position */
    backface-visibility: hidden;
    /* Prevent content shifts */
    contain: layout style paint;
}

.btn-location-subtle:hover:not(:disabled) {
    background: #f3f4f6;
    color: #374151;
}

.btn-location-subtle:active:not(:disabled) {
    background: #e5e7eb;
    color: #1f2937;
}

.btn-location-subtle:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.btn-location-subtle i {
    font-size: 14px;
}

.btn-location-subtle .fa-spinner {
    animation: spinSubtle 1s linear infinite;
}

@keyframes spinSubtle {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Location Status Banner */
.location-status {
    /* FIXED POSITION - Does NOT affect document flow or cause layout shift */
    position: fixed;
    top: calc(var(--header-height) + var(--safe-area-top) + 30px); /* 30px below header for balanced spacing */
    left: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    box-sizing: border-box;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform-origin: top center;
    z-index: 2000; /* Above everything else */
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); /* Make it float */
}

.location-status.hidden {
    /* Completely invisible and non-interactive */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px); /* Subtle slide up when hiding */
}

/* Remove old slideDown animation - using CSS transitions instead */

.location-status-info {
    background: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #2196F3;
}

.location-status-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4CAF50;
}

.location-status-warning {
    background: #fff3e0;
    color: #ef6c00;
    border-left: 4px solid #FF9800;
}

.location-status-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #F44336;
}

.location-status i {
    font-size: 16px;
    flex-shrink: 0;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e5ea;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.autocomplete-dropdown.active {
    display: block;
}

.autocomplete-item {
    /* Increase touch target size for finger-friendly interaction */
    padding: 18px 16px;
    min-height: 60px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Prevent text selection on touch */
    -webkit-user-select: none;
    user-select: none;
    /* Improve tap responsiveness */
    touch-action: manipulation;
}

.autocomplete-item:hover {
    background: #fafafa;
}

.autocomplete-item-name {
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 4px;
    font-size: 16px;
    line-height: 1.3;
}

.autocomplete-item-address {
    font-size: 14px;
    color: #8e8e93;
    line-height: 1.4;
}

/* Distance Badge for Nearby Results */
.distance-badge {
    display: inline-block;
    background: linear-gradient(135deg, #5a9a42 0%, #71B956 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.autocomplete-item-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Buttons */
button {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px; /* Minimum touch target for mobile */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1); /* iOS tap feedback */
    touch-action: manipulation; /* Disable double-tap zoom on iOS */
    -webkit-user-select: none; /* Prevent text selection on touch */
    user-select: none;
}

button:focus {
    outline: 2px solid var(--navy-blue);
    outline-offset: 2px;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--red-grade);
    color: white;
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

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

.btn-danger {
    background: var(--red-grade);
    color: white;
}

.btn-upload {
    background: var(--orange-grade);
    color: white;
}

/* Area Grid */
.area-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px 20px 20px 20px; /* Consistent 20px side margins, reduced top for tight banner spacing */
}

.area-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease-out;
    position: relative;
    min-height: 100px; /* Better touch target */
    border: 2px solid transparent;
    text-align: left;
    width: 100%;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.area-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.area-card:focus {
    outline: none;
    border-color: var(--navy-blue);
    box-shadow: 0 0 0 3px rgba(26, 43, 102, 0.2);
}

.area-card:active {
    transform: scale(0.98);
}

.area-card.active {
    background: var(--navy-blue);
    color: white;
}

.area-card.completed {
    background: var(--green-grade);
    color: white;
}

.area-card.needs-more {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #f59e0b;
}

.area-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.area-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px; /* Tighter spacing to count below */
}

.area-count {
    font-size: 11px;
    opacity: 0.8;
}

/* Camera View */
.camera-view {
    padding: 20px; /* Consistent 20px margins with notification and other sections */
}

/* Camera Counter Overlay - Small tile on video */
.camera-counter-overlay {
    position: absolute;
    top: calc(var(--header-height) + var(--safe-area-top) + 20px); /* Below nav bar */
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    z-index: 100;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: none; /* Hidden by default */
}

/* Show counter only when video is active */
#video.active ~ .camera-counter-overlay {
    display: block;
}

.counter-area-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.counter-number {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    color: white;
    text-align: center;
    margin: 4px 0;
    transition: all 0.3s ease;
}

.counter-number.complete {
    color: var(--green-grade);
}

.counter-number.needs-more {
    color: var(--orange-grade);
}

.counter-min-label {
    font-size: 11px;
    opacity: 0.7;
    text-align: center;
    margin-bottom: 6px;
}

.counter-status-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(113, 185, 86, 0.3);
    color: var(--green-grade);
    text-align: center;
    white-space: nowrap;
}

.counter-status-badge.incomplete {
    background: rgba(230, 114, 52, 0.3);
    color: var(--orange-grade);
}

/* Animation when photo captured */
@keyframes countBump {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.counter-number.bump {
    animation: countBump 0.4s ease;
}

/* Position overlay in fullscreen mode */
.camera-container.fullscreen .camera-counter-overlay {
    position: fixed; /* Fixed positioning in fullscreen */
    top: calc(var(--header-height) + var(--safe-area-top) + 20px); /* Below nav bar */
    left: 20px;
    z-index: 2100; /* Higher than header (1000) and fullscreen video */
}

.camera-container {
    position: relative;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.camera-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    margin: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
}

#video {
    width: 100%;
    height: auto;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
}

#video.active {
    display: block;
    position: relative;
}

.camera-container.fullscreen #video {
    position: relative;
    width: min(100vw, 100vh - 180px); /* Square: use smaller of width or height minus controls */
    height: min(100vw, 100vh - 180px);
    max-width: 90vh;
    max-height: 90vh;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#canvas {
    display: none;
}

/* Square Frame Guide Overlay */
.square-frame-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(85vw, 85vh);
    aspect-ratio: 1/1;
    pointer-events: none;
    z-index: 500;
}

.frame-corners {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.4),
        inset 0 0 0 2px rgba(0, 0, 0, 0.5);
}

.frame-corners::before,
.frame-corners::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid white;
}

/* Top-left corner */
.frame-corners::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
    border-radius: 12px 0 0 0;
}

/* Bottom-right corner */
.frame-corners::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 12px 0;
}

/* Top-right and bottom-left corners using pseudo elements on child */
.square-frame-guide::before,
.square-frame-guide::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid white;
    z-index: 1;
}

/* Top-right corner */
.square-frame-guide::before {
    top: calc(50% - min(42.5vw, 42.5vh));
    right: calc(50% - min(42.5vw, 42.5vh));
    border-left: none;
    border-bottom: none;
    border-radius: 0 12px 0 0;
}

/* Bottom-left corner */
.square-frame-guide::after {
    bottom: calc(50% - min(42.5vw, 42.5vh));
    left: calc(50% - min(42.5vw, 42.5vh));
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 12px;
}

.frame-message {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.frame-message i {
    margin-right: 6px;
    color: #4CAF50;
}

/* Hide guide in fullscreen mode for cleaner view */
.camera-container.fullscreen .square-frame-guide {
    display: none;
}

.camera-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 15px;
}

.camera-container.fullscreen .camera-controls {
    position: fixed;
    bottom: var(--safe-area-bottom); /* Position in bottom black bar - no nav bar offset needed */
    left: 50%;
    transform: translateX(-50%);
    z-index: 2001;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
}

.camera-container.fullscreen .camera-controls button {
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.camera-controls button {
    width: auto;
    min-width: 120px;
    flex-shrink: 0;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 20px; /* Consistent 20px margins with other sections */
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(214, 59, 59, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px; /* Increased for better touch target */
    height: 32px;
    min-width: 32px; /* Prevent flex shrinking */
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    box-sizing: border-box; /* Ensure border-box for perfect circle */
    flex-shrink: 0; /* Prevent flex container from squishing */
    -webkit-tap-highlight-color: transparent; /* Remove iOS tap highlight */
    touch-action: manipulation; /* Improve touch responsiveness */
}

.photo-delete:active {
    background: rgba(214, 59, 59, 1);
    transform: scale(0.95);
}

.photo-uploaded-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(113, 185, 86, 0.95);
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

/* Upload Queue */
.queue-list {
    padding: 20px; /* Consistent 20px margins with other sections */
}

.queue-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    animation: slideInUp 0.3s ease-out;
    transition: all 0.2s ease-out;
}

.queue-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.queue-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.queue-item-title {
    font-weight: 600;
    font-size: 15px;
    color: #1c1c1e;
    flex: 1;
}

.queue-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.queue-action-btn {
    background: none;
    border: none;
    color: #8e8e93;
    font-size: 20px;
    cursor: pointer;
    padding: 10px 12px;
    width: auto;
    min-width: 44px; /* Minimum touch target */
    min-height: 44px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.queue-action-btn:hover {
    color: var(--navy-blue);
}

.queue-action-btn.delete:hover {
    color: #D63B3B;
}

.queue-action-btn.retry:hover {
    color: var(--orange-grade);
}

.queue-status {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.queue-status.pending {
    background: #f0f0f0;
    color: #666;
}

.queue-status.uploading {
    background: #e3f2fd;
    color: #1976d2;
}

.queue-status.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.queue-status.failed {
    background: #ffebee;
    color: #c62828;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--navy-blue);
    transition: width 0.3s;
    border-radius: 3px;
}

/* Report Section */
.report-section {
    padding: 20px; /* Consistent 20px margins with other sections */
}

.report-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.report-card h3 {
    font-size: 18px;
    color: var(--navy-blue);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.stat-item {
    flex: 1;
    background: #f9f9f9;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--navy-blue);
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.report-guidance {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 8px;
    font-size: 13px;
    color: #1976d2;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.report-guidance i {
    margin-top: 2px;
    flex-shrink: 0;
}

.report-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-history-item {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column; /* Stack vertically on mobile for better layout */
    gap: 12px;
}

@media (min-width: 480px) {
    .report-history-item {
        flex-direction: row; /* Horizontal on larger screens */
        justify-content: space-between;
        align-items: center;
    }
}

.report-info {
    flex: 1;
}

.report-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy-blue);
    margin-bottom: 6px;
}

.report-meta {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}

.report-meta i {
    color: #999;
    width: 14px;
}

.report-history-item .btn-secondary {
    width: 100%; /* Full width on mobile */
    justify-content: center;
    white-space: nowrap;
}

@media (min-width: 480px) {
    .report-history-item .btn-secondary {
        width: auto; /* Auto width on larger screens */
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 30px;
}

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

.empty-title {
    font-size: 20px;
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 8px;
}

.empty-message {
    font-size: 14px;
    color: #8e8e93;
    max-width: 300px;
    margin: 0 auto;
}

/* Status Messages */
.status-message {
    padding: 10px 15px;
    border-radius: 10px;
    margin: 8px 20px 0 20px; /* Consistent 20px side margins, reduced top for tight banner spacing */
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.status-message.info {
    background: #e3f2fd;
    color: #1976d2;
}

.status-message.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-message.warning {
    background: #fff3e0;
    color: #ef6c00;
}

.status-message.error {
    background: #ffebee;
    color: #c62828;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    font-size: 20px;
    font-weight: 600;
    color: var(--navy-blue);
    margin-bottom: 16px;
}

/* GPS Modal Specific Styles */
.gps-modal-body {
    text-align: center;
}

.gps-error-icon {
    font-size: 48px;
    color: #FFC107;
    margin: 20px 0;
}

.gps-error-icon i {
    animation: bounce-icon 2s infinite;
}

@keyframes bounce-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.gps-error-message {
    font-size: 16px;
    color: var(--navy-blue);
    margin-bottom: 24px;
    line-height: 1.6;
}

.gps-instructions {
    text-align: left;
    background: rgba(113, 185, 86, 0.1);
    border-left: 4px solid #71B956;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.gps-instructions h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy-blue);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gps-instructions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gps-instructions li {
    font-size: 13px;
    color: var(--navy-blue);
    padding: 6px 0;
    padding-left: 24px;
    position: relative;
}

.gps-instructions li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #71B956;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Gallery Section Header */
.gallery-section {
    margin-bottom: 20px;
}

.gallery-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--navy-blue);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(26, 43, 102, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(26, 43, 102, 0);
    }
}

.btn-pulse {
    animation: pulse 2s infinite;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f0f0f0;
    border-top: 3px solid var(--navy-blue);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

.mt-2 {
    margin-top: 8px;
}

.mb-2 {
    margin-bottom: 8px;
}

/* Feedback Section */
.feedback-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 8px;
    font-size: 14px;
}

select, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e5ea;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

select:focus, textarea:focus {
    outline: 2px solid var(--navy-blue);
    outline-offset: 0;
    border-color: var(--navy-blue);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.app-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================================================ */
/* VIDEO WALKTHROUGH STYLES */
/* ============================================================================ */

/* Video Walkthrough Container */
.video-walkthrough-container {
    padding: 20px;
    padding-bottom: 100px; /* Space for sticky button */
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

.briefing-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.briefing-section h2 {
    color: var(--navy-blue);
    margin-bottom: 12px; /* Tighter spacing to Instructions heading below */
    text-align: left; /* Left align to match instruction items */
    font-size: 24px;
}

.instructions-box {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.instructions-box h3 {
    color: var(--navy-blue);
    margin: 0 0 8px 0; /* Tighter spacing - remove top margin, small bottom margin */
    font-size: 16px;
}

.instruction-list, .mention-list {
    list-style: none;
    padding-left: 0;
}

.instruction-list li, .mention-list li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.5;
}

.instruction-list.compact li {
    padding: 6px 0;
    font-size: 14px;
}

.instruction-list li i, .mention-list li i {
    color: var(--navy-blue);
    font-size: 12px;
    flex-shrink: 0;
}

/* Sticky Record Button */
.sticky-record-button {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: linear-gradient(to top, rgba(255,255,255,1) 70%, rgba(255,255,255,0));
    z-index: 999;
    display: flex;
    justify-content: center;
    pointer-events: none; /* Allow clicks through the container */
}

.sticky-record-button button {
    pointer-events: auto; /* But allow clicks on the button itself */
}

.record-btn-large {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.4);
    transition: all 0.2s ease;
    min-width: 280px;
    justify-content: center;
}

.record-btn-large:hover {
    background: #c82333;
    box-shadow: 0 6px 25px rgba(220, 53, 69, 0.5);
    transform: translateY(-2px);
}

.record-btn-large:active {
    transform: translateY(0);
    box-shadow: 0 2px 15px rgba(220, 53, 69, 0.4);
}

.record-btn-large i {
    font-size: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.meta-info {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.meta-info p {
    margin: 8px 0;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-info i {
    color: var(--navy-blue);
    width: 20px;
}

.large-btn {
    padding: 18px 30px;
    font-size: 18px;
    width: 100%;
    margin-bottom: 12px;
}

/* Record Button with Pulsing Glow */
.record-btn {
    background: var(--navy-blue) !important;
    color: white !important;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(28, 63, 152, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(28, 63, 152, 0.8);
    }
}

/* Video Recording View */
.video-recording-view {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-area-top));
    left: 0;
    right: 0;
    bottom: var(--bottom-nav-height);
    background: rgba(0, 0, 0, 0.95);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orientation-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    z-index: 502;
    animation: fadeIn 0.3s ease-out;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.video-recording-view video {
    width: min(100vw, calc(100vh - var(--header-height) - var(--bottom-nav-height) - 40px));
    height: min(100vw, calc(100vh - var(--header-height) - var(--bottom-nav-height) - 40px));
    max-width: 90vmin;
    max-height: 90vmin;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.recording-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    z-index: 501;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.rec-dot {
    width: 12px;
    height: 12px;
    background: #ff0000;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

.timer {
    font-family: 'Courier New', monospace;
    font-size: 20px;
}

.guidance-text {
    margin-top: 15px;
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.video-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 501;
    padding: 0 20px;
}

.control-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 16px 28px;
    border-radius: 28px;
    font-size: 17px;
    font-weight: 600;
    color: var(--navy-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.2s;
    min-height: 56px; /* Larger touch target for recording controls */
    min-width: 120px;
}

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

.control-btn.stop-btn {
    background: var(--red-grade);
    color: white;
}

.progress-indicator {
    position: absolute;
    bottom: 100px;
    left: 0;
    right: 0;
    padding: 0 20px;
    z-index: 501;
}

#loopProgress {
    background: rgba(0,0,0,0.6);
    padding: 12px 18px;
    border-radius: 25px;
    text-align: center;
}

#distanceStatus {
    color: white;
    font-weight: 500;
    font-size: 14px;
}

/* Video Review Container */
.video-review-container {
    padding: 16px 20px 120px;
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Smaller header to save space */
.video-review-title {
    color: var(--navy-blue);
    margin-bottom: 12px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.video-player-wrapper {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    /* Force square aspect ratio (1:1) */
    aspect-ratio: 1/1;
    position: relative;
}

.video-player-wrapper video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover; /* Crop to fit square container */
}

/* Combined stats - more compact */
.video-stats-combined {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.video-stats-combined p {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.video-stats-combined i {
    color: var(--navy-blue);
    width: 18px;
    flex-shrink: 0;
}

/* Sticky action buttons at bottom */
.action-buttons-sticky {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom)); /* Position above bottom nav */
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(to top, white 70%, rgba(255,255,255,0.95) 90%, transparent);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    z-index: 900; /* Below bottom nav (1000) but above other content */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-buttons-sticky .btn-primary {
    width: 100%;
}

.action-buttons-sticky .btn-text-only {
    background: none;
    border: none;
    color: #666;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    min-height: 0;
}

.action-buttons-sticky .btn-text-only:active {
    opacity: 0.6;
}

/* Legacy styles kept for backwards compatibility */
.quality-checks p i {
    color: var(--navy-blue);
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.action-buttons button {
    flex: 1;
}

.use-video-btn {
    background: var(--navy-blue) !important;
    color: white !important;
}

/* Queue Video Task Styling */
.queue-item.video-task {
    border-left: 4px solid var(--navy-blue);
    background: white;
}

.queue-item.video-task .queue-item-title {
    font-weight: 600;
    color: var(--navy-blue);
}

.video-thumbnail-preview {
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.video-thumbnail-preview img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 180px;
    object-fit: cover;
}

.progress-text {
    text-align: center;
    margin-top: 5px;
    font-size: 14px;
    color: var(--navy-blue);
    font-weight: 600;
}

/* Smooth Transitions and Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.4s ease-out;
}

.slide-in-down {
    animation: slideInDown 0.4s ease-out;
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

.video-walkthrough-container,
.video-recording-view,
.video-review-container {
    animation: fadeIn 0.3s ease-out;
}

.briefing-section,
.video-stats,
.quality-checks {
    animation: slideInUp 0.4s ease-out;
}

/* Progress Details for Video Uploads */
.progress-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 13px;
}

.progress-details .progress-percent {
    font-weight: 600;
    color: var(--navy-blue);
    font-size: 14px;
}

.progress-details .upload-speed,
.progress-details .time-remaining,
.progress-details .bytes-transferred {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #555;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

.progress-details .upload-speed i,
.progress-details .time-remaining i,
.progress-details .bytes-transferred i {
    color: var(--navy-blue);
    font-size: 12px;
}

.progress-details .upload-speed {
    color: #28a745;
    font-weight: 500;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .video-walkthrough-container {
        padding: 15px;
    }

    .briefing-section {
        padding: 20px;
    }

    .briefing-section h2 {
        font-size: 20px;
    }

    .instructions-box {
        padding: 15px;
    }

    .control-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }
}

/* Landscape Mode Adjustments for Video Recording */
@media (orientation: landscape) and (max-height: 600px) {
    .video-controls {
        bottom: 10px;
    }

    .progress-indicator {
        bottom: 60px;
    }

    .control-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Recording Guidance Overlay */
.recording-guidance-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: none; /* Hidden by default */
    z-index: 2050;
}

/* Show guidance when video is active (photo camera) */
#video.active ~ .recording-guidance-overlay {
    display: block;
}

/* Show guidance in video recording view */
.video-recording-view .recording-guidance-overlay {
    display: block;
    position: fixed;
    top: calc(var(--header-height) + var(--safe-area-top));
    left: 0;
    right: 0;
    bottom: var(--bottom-nav-height);
    z-index: 2050;
}

/* Make guidance fixed in fullscreen mode */
.camera-container.fullscreen .recording-guidance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2050;
}

/* Hide guidance when user toggles it off */
.recording-guidance-overlay.hidden {
    display: none !important;
}

/* Framing Guide */
.framing-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    max-width: 400px;
    aspect-ratio: 1;
}

.framing-box {
    position: relative;
    width: 100%;
    height: 100%;
    border: 2px dashed rgba(113, 185, 86, 0.6);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Corner markers */
.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(113, 185, 86, 0.9);
}

.corner.top-left {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 8px;
}

.corner.top-right {
    top: -2px;
    right: -2px;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 8px;
}

.corner.bottom-left {
    bottom: -2px;
    left: -2px;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 8px;
}

.corner.bottom-right {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 8px;
}

.framing-center-text {
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.framing-secondary-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

/* Distance Marker */
.distance-marker {
    position: absolute;
    top: calc(var(--header-height) + var(--safe-area-top) + 20px);
    right: 20px;
    background: rgba(230, 114, 52, 0.85);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    pointer-events: auto;
}

.distance-marker i {
    font-size: 16px;
}

/* Feature Checklist */
.feature-checklist {
    position: absolute;
    bottom: calc(100px + var(--safe-area-bottom));
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 12px;
    min-width: 180px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
}

.checklist-title {
    color: white;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.checklist-item i {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.checklist-item.checked {
    color: var(--green-grade);
}

.checklist-item.checked i {
    color: var(--green-grade);
}

.checklist-item.checked i.fa-square:before {
    content: "\f14a"; /* fa-check-square */
}

/* Recording Tips */
.recording-tips {
    position: absolute;
    bottom: calc(100px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    pointer-events: auto;
}

.tip-content {
    background: rgba(33, 150, 243, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    animation: tipSlideIn 0.5s ease-out;
    transition: opacity 0.3s ease;
}

.tip-content i {
    font-size: 16px;
    animation: tipPulse 2s ease-in-out infinite;
}

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

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

/* Toggle Guidance Button */
.toggle-guidance-btn {
    position: absolute;
    top: calc(var(--header-height) + var(--safe-area-top) + 90px);
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    font-size: 18px;
}

.toggle-guidance-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.05);
}

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

/* Adjust positioning in fullscreen mode */
.camera-container.fullscreen .distance-marker {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-area-top) + 20px);
    right: 20px;
}

.camera-container.fullscreen .feature-checklist {
    position: fixed;
    bottom: calc(100px + var(--safe-area-bottom));
    right: 20px;
}

.camera-container.fullscreen .recording-tips {
    position: fixed;
    bottom: calc(100px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%);
}

.camera-container.fullscreen .toggle-guidance-btn {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-area-top) + 90px);
    left: 20px;
}

/* Mobile Optimizations for Recording Guidance */
@media (max-width: 768px) {
    .framing-guide {
        width: 80%;
    }

    .framing-center-text {
        font-size: 14px;
        padding: 6px 12px;
    }

    .framing-secondary-text {
        font-size: 11px;
        padding: 4px 10px;
    }

    .distance-marker {
        font-size: 11px;
        padding: 8px 12px;
        right: 10px;
    }

    .feature-checklist {
        right: 10px;
        min-width: 160px;
        padding: 10px;
    }

    .checklist-title {
        font-size: 11px;
    }

    .checklist-item {
        font-size: 11px;
        padding: 6px;
    }

    .tip-content {
        font-size: 12px;
        padding: 10px 16px;
    }

    .toggle-guidance-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        left: 10px;
    }
}

/* ================================================== */
/* Video Processing Notification Styles (Alpha 4)    */
/* ================================================== */

/* Video Notification Modal */
#videoNotificationModal {
    z-index: 2000;
}

.video-notification-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    overflow: hidden;
}

.video-notification-header {
    background: var(--navy-blue);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.video-notification-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.btn-close-notification {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-close-notification:hover {
    background: rgba(255,255,255,0.3);
}

/* Progress Bar Section */
.notification-progress-section {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.notification-progress-text {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-progress-text strong {
    color: var(--navy-blue);
    font-size: 16px;
}

.notification-progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.notification-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Notification Feed Section */
.notification-feed-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notification-feed-header {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
}

.notification-feed {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Notification Bubble */
.notification-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: slideIn 0.3s ease;
}

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

.notification-bubble .notification-icon {
    font-size: 16px;
    margin-right: 8px;
}

.notification-bubble .notification-message {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.notification-bubble .notification-timestamp {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* Notification Types */
.notification-bubble.info {
    background: #E3F2FD;
    border-left: 4px solid #2196F3;
}

.notification-bubble.info .notification-icon {
    color: #1976D2;
}

.notification-bubble.progress {
    background: #E3F2FD;
    border-left: 4px solid #2196F3;
}

.notification-bubble.progress .notification-icon {
    color: #1976D2;
}

.notification-bubble.success {
    background: #E8F5E9;
    border-left: 4px solid #4CAF50;
}

.notification-bubble.success .notification-icon {
    color: #388E3C;
}

.notification-bubble.error {
    background: #FFEBEE;
    border-left: 4px solid #F44336;
}

.notification-bubble.error .notification-icon {
    color: #D32F2F;
}

.notification-bubble.warning {
    background: #FFF3E0;
    border-left: 4px solid #FF9800;
}

.notification-bubble.warning .notification-icon {
    color: #F57C00;
}

/* Loading State */
.notification-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

.notification-loading i {
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

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

/* Notification Footer */
.notification-footer {
    padding: 8px 20px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .video-notification-content {
        width: 95%;
        max-height: 70vh;
    }

    .notification-bubble {
        padding: 10px 14px;
    }

    .notification-bubble .notification-message {
        font-size: 13px;
    }
}

/* ========================================
   Error Notification Styles
   Per ERROR-FEEDBACK-INTEGRATION.md
   ======================================== */
.error-notification {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    width: 400px;
    z-index: 1001;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.error-notification-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
}

.error-notification-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.error-notification-header.info { background: #e3f2fd; }
.error-notification-header.warning { background: #fff3e0; }
.error-notification-header.error { background: #ffebee; }
.error-notification-header.critical { background: #ffcdd2; }

.error-notification-icon { font-size: 20px; }
.error-notification-header.info .error-notification-icon { color: #1976d2; }
.error-notification-header.warning .error-notification-icon { color: #f57c00; }
.error-notification-header.error .error-notification-icon { color: #d32f2f; }
.error-notification-header.critical .error-notification-icon { color: #b71c1c; }

.error-notification-title {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.error-notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
}

.error-notification-body { padding: 12px 16px; }

.error-notification-message {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    margin: 0 0 10px 0;
}

.error-notification-action {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 13px;
    color: #555;
}

.error-notification-action i { color: #4CAF50; margin-top: 2px; }
/* ========================================
   Multi-Model Consensus Display (Alpha 6)
   ======================================== */

.consensus-display {
    margin-bottom: 20px;
}

.consensus-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.consensus-header {
    text-align: center;
    margin-bottom: 20px;
}

.consensus-header h3 {
    color: var(--navy-blue);
    font-size: 18px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.consensus-header p {
    color: #666;
    font-size: 13px;
    margin: 0;
}

/* Consensus Summary - Score and Badge */
.consensus-summary {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Consensus Score */
.consensus-score {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 3px solid;
    transition: transform 0.2s;
}

.consensus-score:hover {
    transform: translateY(-2px);
}

.consensus-score.score-green {
    border-color: var(--green-grade);
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f1 100%);
}

.consensus-score.score-yellow {
    border-color: var(--orange-grade);
    background: linear-gradient(135deg, #fff3e0 0%, #fff8f1 100%);
}

.consensus-score.score-red {
    border-color: var(--red-grade);
    background: linear-gradient(135deg, #ffebee 0%, #fff0f1 100%);
}

.score-number {
    font-size: 48px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 8px;
}

.score-green .score-number {
    color: var(--green-grade);
}

.score-yellow .score-number {
    color: var(--orange-grade);
}

.score-red .score-number {
    color: var(--red-grade);
}

.score-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Confidence Badge */
.confidence-badge {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s;
}

.confidence-badge:hover {
    transform: translateY(-2px);
}

.confidence-badge i {
    font-size: 24px;
    margin-bottom: 4px;
}

.confidence-badge span {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.confidence-badge strong {
    font-size: 20px;
}

.badge-high {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
}

.badge-high i {
    color: var(--green-grade);
}

.badge-medium {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
}

.badge-medium i {
    color: var(--orange-grade);
}

.badge-low {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
}

.badge-low i {
    color: var(--red-grade);
}

/* Disagreement Warning */
.disagreement-warning {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid var(--orange-grade);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.warning-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #e65100;
}

.warning-icon {
    font-size: 20px;
    color: var(--orange-grade);
}

.warning-header strong {
    font-size: 16px;
}

.warning-content p {
    margin: 0 0 12px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.warning-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.warning-stat {
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.warning-stat span {
    color: #666;
}

.warning-stat strong {
    color: var(--navy-blue);
    font-size: 16px;
}

/* Model Breakdown */
.model-breakdown {
    background: #f9f9f9;
    border-radius: 12px;
    overflow: hidden;
}

.breakdown-header {
    background: var(--navy-blue);
    color: white;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    user-select: none;
}

.breakdown-header:hover {
    background: #253d7a;
}

.breakdown-header i {
    transition: transform 0.3s;
}

.breakdown-header span {
    font-weight: 600;
    font-size: 14px;
}

.model-breakdown-details {
    padding: 16px;
    display: none;
}

/* Breakdown Items */
.breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.breakdown-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.breakdown-item.perfect .breakdown-icon {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: var(--green-grade);
}

.breakdown-item.majority .breakdown-icon {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1976d2;
}

.breakdown-item.disagreement .breakdown-icon {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: var(--red-grade);
}

.breakdown-info {
    flex: 1;
}

.breakdown-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
}

.breakdown-desc {
    font-size: 12px;
    color: #666;
}

.breakdown-stats {
    text-align: right;
}

.breakdown-count {
    font-size: 24px;
    font-weight: bold;
    color: var(--navy-blue);
    line-height: 1;
}

.breakdown-percent {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.breakdown-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(26, 43, 102, 0.05);
    border-radius: 8px;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

.breakdown-footer i {
    color: var(--navy-blue);
}

/* No Data State */
.no-consensus-data {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 20px;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .consensus-summary {
        flex-direction: column;
    }

    .consensus-score,
    .confidence-badge {
        max-width: 100%;
    }

    .warning-stats {
        justify-content: center;
    }

    .breakdown-item {
        flex-wrap: wrap;
    }

    .breakdown-stats {
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }
}

/* ========================================
   Map Visualization Styles (Alpha 52)
   ======================================== */

/* Map Container */
.map-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e5ea;
}

.map-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--navy-blue);
}

.map-controls {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #f0f0f0;
    color: var(--navy-blue);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--navy-blue);
    color: white;
}

.btn-icon:focus {
    outline: 2px solid var(--navy-blue);
    outline-offset: 2px;
}

/* Map View */
.map-view {
    flex: 1;
    min-height: 400px;
    background: #f0f0f0;
    position: relative;
}

/* Map Legend */
.map-legend {
    display: flex;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e5e5ea;
    font-size: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

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

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.legend-marker.good { background: #4ade80; }
.legend-marker.moderate { background: #fbbf24; }
.legend-marker.poor { background: #fb923c; }
.legend-marker.session { 
    background: #3b82f6; 
    border-radius: 0;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 16px solid #3b82f6;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

/* Map Stats */
.map-stats {
    display: flex;
    gap: 24px;
    padding: 12px 20px;
    background: #f5f5f7;
    border-top: 1px solid #e5e5ea;
    justify-content: center;
}

.map-stats .stat {
    display: flex;
    gap: 6px;
    font-size: 13px;
    align-items: baseline;
}

.map-stats .stat-label {
    color: #666;
}

.map-stats .stat-value {
    font-weight: 600;
    color: var(--navy-blue);
}

/* Map Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.map-popup {
    text-align: center;
    padding: 12px;
}

.popup-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--navy-blue);
}

.popup-thumbnail {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin: 8px 0;
}

.popup-coords {
    font-size: 11px;
    font-family: monospace;
    color: #666;
    margin: 4px 0;
}

.popup-accuracy {
    font-size: 11px;
    font-weight: 600;
    margin: 4px 0;
}

.popup-accuracy.good { color: #4ade80; }
.popup-accuracy.moderate { color: #fbbf24; }
.popup-accuracy.poor { color: #fb923c; }
.popup-accuracy.unknown { color: #6b7280; }

.popup-timestamp {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

.popup-address {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .map-header h2 {
        font-size: 18px;
    }
    
    .map-legend {
        font-size: 11px;
        padding: 8px 12px;
    }
    
    .map-stats {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .popup-thumbnail {
        width: 150px;
        height: 150px;
    }
}

/* ========================================
   GPS Coordinate Display (Alpha 51)
   ======================================== */

/* GPS Overlay on Photo Cards */
.photo-gps-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    z-index: 10;
}

/* GPS Coordinates */
.photo-gps-coords {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
    user-select: none;
    flex: 1;
    min-width: 0;
}

.photo-gps-coords:hover {
    opacity: 0.8;
}

.photo-gps-coords:active {
    opacity: 0.6;
}

.photo-gps-coords i {
    font-size: 12px;
    flex-shrink: 0;
    color: #4ade80;
}

.photo-gps-coords span {
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* GPS Accuracy Badge */
.photo-gps-accuracy {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.photo-gps-accuracy.good {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.2);
}

.photo-gps-accuracy.moderate {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.2);
}

.photo-gps-accuracy.poor {
    color: #fb923c;
    background: rgba(251, 146, 60, 0.2);
}

.photo-gps-accuracy.unknown {
    color: #6b7280;
    background: rgba(107, 114, 128, 0.2);
}

/* Google Maps Link */
.photo-gps-map-link {
    color: white;
    text-decoration: none;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-gps-map-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.photo-gps-map-link:active {
    background: rgba(255, 255, 255, 0.3);
}

/* No GPS Data */
.no-gps {
    color: #6b7280;
    font-size: 10px;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .photo-gps-overlay {
        padding: 3px 6px;
        font-size: 10px;
    }

    .photo-gps-coords span {
        font-size: 9px;
    }

    .photo-gps-accuracy {
        font-size: 9px;
        padding: 2px 4px;
    }

    .photo-gps-map-link {
        font-size: 9px;
    }
}

/* Accessibility - Focus States */
.photo-gps-coords:focus,
.photo-gps-map-link:focus {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}

/* ============================================================================
   Zone Selection UI — Structured capture flow (#22)
   ============================================================================ */

/* Zone Progress Bar */
.zone-progress-bar {
    padding: 12px 20px;
    background: white;
    margin: 0 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.zone-progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-blue);
    margin-bottom: 8px;
}

.zone-progress-track {
    height: 6px;
    background: #e5e5ea;
    border-radius: 3px;
    overflow: hidden;
}

.zone-progress-fill {
    height: 100%;
    background: var(--green-grade);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Zone Grid */
.zone-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px 20px;
}

/* Zone Card */
.zone-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease-out;
    position: relative;
    min-height: 120px;
    border: 2px solid #e5e5ea;
    text-align: left;
    width: 100%;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.zone-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.zone-card:focus {
    outline: none;
    border-color: var(--navy-blue);
    box-shadow: 0 0 0 3px rgba(26, 43, 102, 0.2);
}

.zone-card:active {
    transform: scale(0.98);
}

/* Zone card states */
.zone-card.zone-not-started {
    background: #f9fafb;
    border-color: #e5e5ea;
    color: #6b7280;
}

.zone-card.zone-in-progress {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.zone-card.zone-complete {
    background: #f0fdf4;
    border-color: var(--green-grade);
    color: #166534;
}

.zone-card-icon {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}

.zone-card.zone-not-started .zone-card-icon {
    color: #9ca3af;
}

.zone-card.zone-in-progress .zone-card-icon {
    color: #f59e0b;
}

.zone-card.zone-complete .zone-card-icon {
    color: var(--green-grade);
}

.zone-card-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.3;
}

.zone-card-ibhs {
    font-size: 10px;
    opacity: 0.6;
    font-family: 'Courier New', monospace;
    margin-bottom: 6px;
}

.zone-card-count {
    font-size: 12px;
    font-weight: 500;
    margin-top: auto;
}

.zone-card-status {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 16px;
}

.zone-card.zone-complete .zone-card-status {
    color: var(--green-grade);
}

.zone-card.zone-in-progress .zone-card-status {
    color: #f59e0b;
}

/* Zone Actions */
.zone-actions {
    padding: 12px 20px 20px;
}

/* Zone Camera Indicator Overlay */
.zone-camera-indicator {
    position: absolute;
    top: calc(var(--header-height) + var(--safe-area-top) + 20px);
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    z-index: 100;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: none;
    text-align: center;
}

#video.active ~ .zone-camera-indicator {
    display: block;
}

.zone-indicator-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    white-space: nowrap;
}

.zone-indicator-progress {
    font-size: 11px;
    opacity: 0.8;
}

/* Zone-aware camera control buttons */
.btn-zone-complete {
    background: var(--green-grade);
    color: white;
}

.btn-next-zone {
    background: var(--navy-blue);
    color: white;
}

/* Position zone indicator in fullscreen mode */
.camera-container.fullscreen .zone-camera-indicator {
    position: fixed;
    top: calc(var(--header-height) + var(--safe-area-top) + 20px);
    right: 20px;
    z-index: 2100;
}

/* Session Summary Screen */
.summary-header {
    padding: 20px 20px 12px;
}

.summary-header h2 {
    color: var(--navy-blue);
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.summary-address {
    font-size: 14px;
    color: #6b7280;
}

.summary-zone-list {
    padding: 0 20px;
}

.summary-zone-item {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 2px solid transparent;
}

.summary-zone-item.summary-complete {
    border-color: var(--green-grade);
}

.summary-zone-item.summary-incomplete {
    border-color: #e5e5ea;
}

.summary-zone-item.summary-in-progress {
    border-color: #f59e0b;
}

.summary-zone-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.summary-complete .summary-zone-icon {
    color: var(--green-grade);
}

.summary-incomplete .summary-zone-icon {
    color: #9ca3af;
}

.summary-in-progress .summary-zone-icon {
    color: #f59e0b;
}

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

.summary-zone-name {
    font-size: 14px;
    font-weight: 600;
    color: #1c1c1e;
}

.summary-zone-detail {
    font-size: 12px;
    color: #6b7280;
}

.summary-zone-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.summary-complete .summary-zone-badge {
    background: rgba(90, 154, 66, 0.15);
    color: var(--green-grade);
}

.summary-incomplete .summary-zone-badge {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.summary-in-progress .summary-zone-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.summary-actions {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive — Zone Grid */
@media (max-width: 480px) {
    .zone-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px 12px;
    }

    .zone-card {
        padding: 12px;
        min-height: 100px;
    }

    .zone-card-icon {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .zone-card-label {
        font-size: 13px;
    }

    .zone-progress-bar {
        margin: 0 12px;
    }

    .zone-actions {
        padding: 8px 12px 16px;
    }

    .summary-header {
        padding: 16px 12px 8px;
    }

    .summary-zone-list {
        padding: 0 12px;
    }

    .summary-actions {
        padding: 12px 12px 16px;
    }
}

/* Landscape mode — zone grid 3 columns */
@media (orientation: landscape) and (max-height: 600px) {
    .zone-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .zone-card {
        min-height: 90px;
        padding: 10px;
    }

    .zone-card-icon {
        font-size: 22px;
        margin-bottom: 4px;
    }

    .summary-zone-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .summary-zone-item {
        margin-bottom: 0;
    }
}

/* Tablet — zone grid 3 columns */
@media (min-width: 600px) {
    .zone-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
