@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700&display=swap');

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    color: white;
}

/* UI Layer - sits above AR */
/* --- Modern Glassmorphism Theme --- */

/* Glass Utility */
.glass-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* UI Overlay Container */
#ui-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Enable pointer events for interactive elements */
#menu-btn,
#settings-modal {
    pointer-events: auto;
}

/* Modern Menu Button */
#menu-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    /* Smooth rounded square (Squircle-ish) */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    z-index: 1001;
}

/* Inherit Glass Style */
#menu-btn {
    background: rgba(20, 20, 20, 0.4);
    /* Slightly darker for contrast */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

#menu-btn:active {
    transform: scale(0.95);
    background: rgba(20, 20, 20, 0.6);
}

#menu-btn svg {
    fill: rgba(255, 255, 255, 0.9);
    width: 24px;
    height: 24px;
}

/* Modern Settings Modal */
#settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#settings-modal.active {
    opacity: 1;
    visibility: visible;
}

.settings-card {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    width: 85%;
    max-width: 340px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#settings-modal.active .settings-card {
    transform: scale(1);
}

.settings-card h2 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 1.5rem;
    font-weight: 500;
    text-align: center;
    color: white;
    letter-spacing: 0.5px;
}

/* Settings Options */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.setting-label {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

/* Modern Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: #3b82f6;
    /* Modern Blue */
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Close Button */
#close-settings {
    background: white;
    color: black;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}

#close-settings:active {
    opacity: 0.8;
}

/* --- Viewfinder & Instruction UI --- */

/* Viewfinder Overlay Layer */
#viewfinder-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 900;
}

/* Corner Guides */
.corner-guide {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: rgba(255, 255, 255, 0.4);
    border-style: solid;
    border-width: 0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.corner-top-left {
    top: 30px;
    left: 30px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.corner-top-right {
    top: 30px;
    right: 30px;
    border-top-width: 2px;
    border-right-width: 2px;
}

.corner-bottom-left {
    bottom: 30px;
    left: 30px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.corner-bottom-right {
    bottom: 30px;
    right: 30px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

/* Instruction Pill */
.instruction-container {
    position: absolute;
    bottom: 50px;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 1002;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.instruction-pill {
    background: rgba(15, 15, 15, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.instruction-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: white;
    letter-spacing: 0.5px;
}

.instruction-icon {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.hidden-ui {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}