/*
 #081016; // black
 #0080D0; // blue
 #0060D0; // dark blue
 #FD5A00; // orange
 #4CAF50; // green
 #45a049; // dark green
 #f4f4f4; // background
*/

:root {
    --primary-color: #0070a0;
    --secondary-color: #0080b0;
    --background-color: #f4f4f4;
    --darkbackground-color: #081016;
    --text-color: #333;
    --error-color: #fd5a00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--darkbackground-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-weight: 500;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.5rem;
    margin: 1rem 0;
    color: #0070a0;
    display: flex;
    align-items: center;
    justify-content: center;
}

h1 i {
    margin-right: 0.75rem;
    color: #0070a0;
}

.screen {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 40px;
}

.hidden {
    display: none !important;
}

.login-container {
    width: 100%;
    max-width: 400px;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

input[type="text"] {
    font-family: 'Roboto Mono', monospace;
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
    background-color: rgba(255, 255, 255, 0.95);
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    /*width: 100%;*/
}

#map {
    width: 100%;
    height: calc(100vh - 60px); /* Account for header height */
    margin-bottom: 0;
}

.controls {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: transparent;
    pointer-events: none;
}

.controls button {
    position: absolute;
    z-index: 1001;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

.controls button:disabled {
    background-color: rgba(255, 255, 255, 0.5);
    color: rgba(0, 0, 0, 0.3);
    cursor: not-allowed;
}

.controls button.disable {
    background-color: rgba(255, 255, 255, 0.5);
    color: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* Camera button styling */
#camera-btn {
    width: 72px;
    height: 72px;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    border: 3px solid #15be0f; /* Green border by default when camera is available */
}

#camera-btn:disabled,
#camera-btn.disable {
    border-color: #cccccc; /* Gray border when camera is not available */
}

#camera-btn i {
    font-size: 48px;
}

/* Voice button styling */
#voice-btn {
    width: 48px;
    height: 48px;
    top: 80px; /* Account for header */
    left: 16px; /* Changed from 72px to remove gap */
}

#voice-btn i {
    font-size: 20px;
}

/* Notes button styling */
#notes-btn {
    width: 48px;
    height: 48px;
    top: 80px; /* Account for header */
    left: 72px; /* Position it to the right of the voice button */
}

#notes-btn i {
    font-size: 20px;
}

/* Measurement button styling */
#measurement-btn {
    width: 48px;
    height: 48px;
    top: 80px; /* Account for header */
    left: 128px; /* Position it to the right of the notes button */
}

#measurement-btn i {
    font-size: 20px;
}

#camera-preview {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    object-fit: cover;
}

#splash-screen {
    padding-top: 40px;
}

/*.camera-controls {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: auto;
}

.camera-controls button {
    flex: 1;
    position: relative;
    z-index: 1001;
    font-weight: bold;
}*/

#pwa-install {
    margin-top: 2rem;
}

@media (max-width: 600px) {
    .screen {
        padding: 10px;
    }

    h1 {
        font-size: 24px;
    }

    button {
        padding: 10px 20px;
    }
}

.app-header {
    width: 100%;
    padding: 0.5rem; /** 1rem*/
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.app-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.menu-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    text-shadow: none; /* Remove any shadow if present */
}

.menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    padding: 0.5rem;
    min-width: 150px;
}

.menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}

.menu button:hover {
    background-color: var(--background-color);
}

#map-screen {
    background-color: var(--background-color);
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

#map-screen .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

#map-screen #map {
    margin-top: 60px; /* Height of the header */
}

/* Add padding to the bottom of the capture screen to ensure buttons don't overlap content */
#capture-screen {
    padding-bottom: 0; /* Remove extra padding since we're using fixed positioning */
    overflow: hidden; /* Prevent scrolling */
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-icon {
    width: 240px;
    height: 240px;
    margin-bottom: 2rem;
    border-radius: 24px;
    object-fit: contain;
}

.button-container {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.button-container button {
    flex: 1;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.disable {
    background-color: #cccccc !important;
    cursor: pointer;
}

#qr-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#qr-container button {
    width: 100%;
    max-width: 200px;
}

.close-btn {
    align-self: flex-end;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50%;
    background-color: #f4f4f4;
    color: #333;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    flex: 0 0 auto !important;
    max-width: none !important;
}

.item-window {
    position: relative;
    padding: 4px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
}

.item-window img {
    width: 100%;
    height: auto;
    max-height: 256px;
    object-fit: contain;
    margin: 10px 0;
}

@media (max-width: 600px) {
    .app-icon {
        width: 250px;
        height: 150px;
    }
}

.sync-status {
    width: 32px;
    height: 32px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    margin-right: 0;
}

.sync-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #707070; /* Gray for default */
    transition: background-color 0.3s ease;
}

.sync-status.online .sync-indicator {
    background-color: #38d640; /* Green for online */
}

.sync-status.busy .sync-indicator {
    background-color: #FFC107; /* Yellow for busy */
    animation: pulse 0.5s infinite;
}

.sync-status.failed .sync-indicator {
    background-color: #F44336; /* Red for failed */
    animation: pulse 3s infinite;
}

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

@keyframes thinking {
    0% { background-color: rgba(255, 255, 255, 0.05); }
    50% { background-color: rgba(255, 255, 255, 0.2); }
    100% { background-color: rgba(255, 255, 255, 0.05); }
}

.status-bar {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.05);
    margin: 0 1rem;
    letter-spacing: -0.02em;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.status-bar.accuracy-high {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 5px #4CAF50;
    background-color: rgba(255, 255, 255, 0.1);
}

.status-bar.accuracy-medium {
    border-color: #FC8523 !important;
    box-shadow: 0 0 5px #FC8523;
    animation: thinking 3.5s ease-in-out infinite;
}

/* Stop the thinking animation when movement is detected */
.status-bar.movement-detected {
    animation: none !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.status-bar.accuracy-low {
    border-color: #ee1000 !important; /* Red for low accuracy */
    animation: borderBlinkLow 4s infinite;
    animation: thinking 2.5s ease-in-out infinite;
}

.status-bar.accuracy-moving {
    border-color: #3bd8ff !important; 
}

.status-bar.location-unavailable {
    border-color: #c0c0c0 !important; /* Grey for unavailable location */
}

@keyframes borderBlinkLow {
    0% { border-color: #ee1000; }
    50% { border-color: transparent; }
    100% { border-color: #ee1000; }
}

@keyframes borderBlinkMedium {
    0% { border-color: #FC8523; }
    50% { border-color: transparent; }
    100% { border-color: #FC8523; }
}

.message-container {
    color: var(--primary-color);
    text-align: center;
    margin: 1rem 0;
    line-height: 1.4;
    padding: 1rem;
    border-radius: 4px;
    max-width: 400px;
    width: 100%;
}

/* Mapbox Controls Styling */
.mapboxgl-ctrl-group {
    background-color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.mapboxgl-ctrl-group button {
    width: 29px !important;
    height: 29px !important;
    margin: 0 !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Style for all control buttons including zoom and compass */
.mapboxgl-ctrl-group button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,
.mapboxgl-ctrl-group button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,
.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,
.mapboxgl-ctrl-group button .mapboxgl-ctrl-icon {
    width: 29px !important;
    height: 29px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: white !important;
    color: var(--primary-color) !important;
}

/* Style for our custom satellite toggle and all other icons */
.mapboxgl-ctrl-icon i,
.mapboxgl-ctrl-icon {
    font-size: 18px !important;
    color: var(--primary-color) !important;
}

/* Hover state for all control buttons */
.mapboxgl-ctrl-group button:hover {
    background-color: #f0f0f0 !important;
}

/* Active/focused state for all control buttons */
.mapboxgl-ctrl-group button:active,
.mapboxgl-ctrl-group button:focus {
    background-color: #e6e6e6 !important;
}

/* Style for the compass arrow */
.mapboxgl-ctrl-compass-arrow {
    width: 20px !important;
    height: 20px !important;
    margin: 5px !important;
    background-color: var(--primary-color) !important;
}

.custom-popup {
    z-index: 200 !important;  /* Ensure popup appears above markers */
}

/* Specific styling for capture screen controls */
#capture-screen .controls {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding-bottom: 32px;
    gap: 16px;
    height: 100%;
    background-color: transparent;
    pointer-events: none;
}
#capture-screen .controls button {
    position: relative;
    width: 120px;
    height: 48px;
    border-radius: 24px;
    pointer-events: auto;
}

#capture-btn {
    background-color: var(--primary-color) !important;
    color: white !important;
}

#cancel-btn {
    background-color: rgba(255, 255, 255, 0.9) !important;
    color: var(--text-color) !important;
}

/* Delete Confirmation Modal Styling */
#delete-confirm-modal .modal-content {
    background-color: white;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

#delete-confirm-modal .modal-header {
    border-bottom: 1px solid #eee;
    padding: 1rem 1.5rem;
}

#delete-confirm-modal .modal-title {
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
}

#delete-confirm-modal .modal-body {
    padding: 1.5rem;
    color: var(--text-color);
}

#delete-confirm-modal .modal-footer {
    border-top: 1px solid #eee;
    padding: 1rem 1.5rem;
}

#delete-confirm-modal .btn-secondary {
    background-color: #f4f4f4;
    border: none;
    color: var(--text-color);
}

#delete-confirm-modal .btn-danger {
    background-color: var(--error-color);
    border: none;
}

#delete-confirm-modal .close {
    color: var(--text-color);
    opacity: 0.5;
    transition: opacity 0.3s;
}

#delete-confirm-modal .close:hover {
    opacity: 1;
}

.recording-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.recording-dialog.hidden {
    display: none;
}

.recording-dialog-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    width: 300px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.recording-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recording-title i {
    color: #ff4444;
    margin-right: 10px;
    animation: pulse 1.5s infinite;
}

.recording-timer-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.recording-timer {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    font-family: 'Roboto Mono', monospace;
    position: absolute;
    z-index: 2;
}

.recording-progress-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    position: absolute;
    z-index: 1;
    visibility: visible !important;
    opacity: 1 !important;
}

.progress-circle-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 5;
    visibility: visible !important;
    opacity: 1 !important;
}

.progress-circle {
    fill: none;
    stroke: #ff4444;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
    visibility: visible !important;
    opacity: 1 !important;
    transform-origin: center;
}

/* Delete the old linear progress styles */
.recording-progress-bar {
    display: none;
}

.recording-progress {
    display: none;
}

.recording-waveform-container {
    width: 100%;
    height: 60px;
    margin-bottom: 15px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f5f5f5;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.recording-waveform {
    display: block;
    width: 100%;
    height: 100%;
    background-color: transparent;
}

.recording-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

#save-recording-btn,
#cancel-recording-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    flex: 1;
}

#save-recording-btn:hover,
#cancel-recording-btn:hover {
    transform: scale(1.05);
}

/* Override existing styling for cancel button to match new layout */
#cancel-recording-btn {
    /* Existing styling kept */
}

/* Keep Still Progress Bar */
.keep-still-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 0;
    background-color: #3bd8ff;
    /* transition duration is now set dynamically in JavaScript */
}

/* Add styling for disabled state */
.status-bar.location-disabled {
    background-color: rgba(200, 200, 200, 0.15);  /* Lighter background */
    border-color: #aaa !important;  /* Lighter border */
    color: #e0e0e0;  /* Much lighter text for better contrast */
    animation: none !important;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);  /* Subtle text shadow for better readability */
}

.status-bar.location-disabled:hover {
    background-color: rgba(200, 200, 200, 0.25);  /* Slightly lighter on hover */
    color: #ffffff;  /* Full white text on hover */
}

/* Upload Dialog Styles */
.upload-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.upload-dialog.hidden {
    display: none;
}

.upload-dialog-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    width: 300px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.upload-spinner {
    margin-bottom: 15px;
}

.upload-spinner i {
    font-size: 48px;
    color: var(--primary-color);
}

.upload-message {
    color: var(--text-color);
    font-size: 16px;
}

#sync-counter {
    display: none;
    background-color: #F44336;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    padding: 0 6px;
    align-items: center;
    justify-content: center;
    animation: pulse 3s infinite;
} 