:root {
    --navy-blue: #1a2b66;
    --papyrus-gold: #f5e6d3;
    --papyrus-light: #faf3e8;
    --papyrus-medium: #f0ddc0;
    --green-grade: #71B956;
    --orange-grade: #E67234;
    --red-grade: #D63B3B;
    --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;
    background: #f5f5f7;
    min-height: 100vh;
    overflow-x: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* 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;
}

/* 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;
}

.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;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.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: #8e8e93;
}

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

.nav-item i {
    font-size: 24px;
    margin-bottom: 4px;
}

.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: 15px;
}

.session-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

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

.session-banner-info .address {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy-blue);
}

.session-banner-time {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 8px;
}

.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: 20px 15px;
}

.session-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    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: none;
    border-color: var(--navy-blue);
    background: #fafafa;
}

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

.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 {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

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

.autocomplete-item-name {
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 2px;
    font-size: 14px;
}

.autocomplete-item-address {
    font-size: 12px;
    color: #8e8e93;
}

/* 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: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: 15px;
}

.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 */
}

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

.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: 4px;
}

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

/* Camera View */
.camera-view {
    padding: 15px;
}

/* 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;
}

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

.camera-container.fullscreen .camera-controls {
    position: fixed;
    bottom: calc(60px + var(--safe-area-bottom));
    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.7) 0%, 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: 15px;
}

.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: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
}

.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: 15px;
}

.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: 15px;
}

.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;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.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;
}

/* 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: 12px 15px;
    border-radius: 10px;
    margin: 15px 15px 0 15px;
    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;
}

/* 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: none;
    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;
    max-width: 600px;
    margin: 0 auto;
}

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

.briefing-section h2 {
    color: var(--navy-blue);
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
}

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

.instructions-box h3 {
    color: var(--navy-blue);
    margin: 24px 0;
    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 li i, .mention-list li i {
    color: var(--navy-blue);
    font-size: 12px;
    flex-shrink: 0;
}

.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: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.video-review-container h2 {
    color: var(--navy-blue);
    margin-bottom: 20px;
    text-align: center;
}

.video-player-wrapper {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.video-player-wrapper video {
    width: 100%;
    display: block;
}

.video-stats {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.video-stats p {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #333;
}

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

.quality-checks {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.quality-checks p {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #333;
}

.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; }