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

body,
html {
    width: 100%;
    height: 100%;
    font-family: 'Outfit', sans-serif;
    background-color: #0f172a;
    color: #f8fafc;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.fs-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Background gradient for setup */
.setup-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.setup-panel {
    padding: 40px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

.sun-icon {
    font-size: 64px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.6));
    animation: pulse 3s infinite alternate;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(to right, #fef08a, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.permissions-list {
    text-align: left;
    margin-bottom: 30px;
}

.perm-item {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.glow-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.mode-toggle button.active {
    background: #f59e0b;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.search-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.help-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    color: #ffffff !important;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s;
    pointer-events: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6) !important;
    flex-shrink: 0;
}

.help-btn:hover {
    background: #0f172a !important;
    transform: scale(1.1);
    border-color: #ffffff !important;
}

.search-help-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 320px;
    z-index: 1000;
}

/* Specific positioning for Settings vs Search Help */
#info-modal {
    top: calc(76px + env(safe-area-inset-top, 0px));
    right: 20px;
    width: 260px;
}

.help-section h4 {
    margin: 10px 0 5px 0;
    color: #fef08a;
}

.help-section ol {
    padding-left: 20px;
    margin: 5px 0;
}

.help-section li {
    margin-bottom: 8px;
    font-size: 14px;
    color: #e2e8f0;
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

.help-section h4 {
    margin: 10px 0 5px 0;
    color: #fef08a;
}

.help-section ol {
    padding-left: 20px;
    margin: 5px 0;
}

.help-section li {
    margin-bottom: 5px;
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

.glow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.glow-btn:active {
    transform: translateY(0);
}

.error-msg {
    color: #ef4444;
    margin-top: 16px;
    font-size: 14px;
    display: none;
}

/* AR Interface */
#camera-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#ar-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    pointer-events: none;
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.top-bar {
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 16px 16px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

.icon-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

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

.info-modal {
    position: absolute;
    padding: 20px;
    pointer-events: auto;
    animation: fadeIn 0.2s ease-out;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.info-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #f59e0b;
}

.close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.info-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-row .label {
    font-size: 13px;
    color: #94a3b8;
}

.info-row .value {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.date-picker-container input {
    background: rgba(15, 23, 42, 0.6);
    /* Darker glassmorphism background for high contrast */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 16px;
    /* Best for mobile to prevent auto-zoom */
    outline: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    -webkit-appearance: none;
    appearance: none;
    min-height: 44px;
}

.date-picker-container {
    position: relative;
}

.date-picker-container input::-webkit-date-and-time-value {
    text-align: left;
}

.date-picker-container input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.7;
    cursor: pointer;
}

.bottom-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    width: 100%;
}

.bottom-bar .search-container {
    width: 100%;
    pointer-events: auto; /* Required to click */
}

.status-panel {
    display: flex;
    justify-content: center;
    pointer-events: auto; /* Required if user wants to click it later */
}

.glass-pill {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.loading {
    background-color: #f59e0b;
    animation: blink 1s infinite;
}

.dot.active {
    background-color: #10b981;
}

.dot.error {
    background-color: #ef4444;
}

#status-msg {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    from {
        filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.4));
    }

    to {
        filter: drop-shadow(0 0 30px rgba(250, 204, 21, 0.8));
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Mode Toggle & Search Styles */
.mode-toggle {
    display: flex;
    padding: 4px;
    gap: 4px;
}

.mode-toggle button {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mode-toggle button.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.search-container {
    flex: 1;
    max-width: 450px; /* Increased from 300px for larger default width */
}

.search-container input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    padding: 12px 20px; /* Made globally taller */
    border-radius: 30px;
    font-family: inherit;
    font-size: 15px; /* Increased globally */
    outline: none;
}

.search-container input::placeholder {
    color: #ffffff !important;
}

#street-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    filter: invert(1) contrast(1.15) !important;
}

/* Ensure Google Autocomplete results are visible above the AR overlay */
.pac-container {
    z-index: 10000 !important;
    background-color: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    margin-top: 5px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

.pac-item {
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 10px 15px !important;
    color: #f8fafc !important;
    cursor: pointer;
}

.pac-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.pac-item-query {
    color: #fff !important;
}

.pac-matched {
    color: #f59e0b !important;
}

/* Mobile search style adjustment */
@media (max-width: 768px) {
    .top-bar {
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 8px;
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .mode-toggle {
        padding: 2px;
    }
    
    .mode-toggle button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .date-picker-container input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .icon-btn {
        width: 38px;
        height: 38px;
    }

    .search-container {
        width: 100%;
        max-width: none;
    }

    .search-group {
        width: 100%;
    }

    .search-container input {
        flex: 1;
        /* Take up all available space */
        font-size: 16px;
        /* Larger font for readability and prevents iOS auto-zoom */
        padding: 12px 20px;
        /* Larger touch target */
    }

    .help-btn {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }
}