/* =================== HUD OVERLAY STYLES =================== */
.hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 50;
}

.hud-overlay * {
    pointer-events: auto;
}

/* Top Controls */
.hud-top-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 60;
}

.hud-menu-container {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.hud-menu-items {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 15rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 0.25rem;
}

.hud-menu-items.collapsed {
    max-width: 0;
    padding-left: 0;
}

/* Side Controls */
.hud-side-controls {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    z-index: 60;
}

.hud-side-controls .hud-menu-container {
    flex-direction: column;
    gap: 0.25rem;
}

/* Bottom Controls */
.hud-bottom-controls {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-direction: column-reverse;
}

.hud-camera-button {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.hud-camera-button:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.hud-camera-icon {
    width: 2rem;
    height: 2rem;
    color: white;
}

/* View Mode Toggle */
.hud-view-toggle {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 60;
}

.hud-mode-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #ff0000;
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(255, 0, 0, 0.3);
}

.hud-mode-button:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(255, 0, 0, 0.4);
}

.hud-mode-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Icon Buttons */
.hud-icon-button {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    color: rgba(55, 65, 81, 1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-icon-button:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
}

.hud-icon-button.active {
    background: white;
    color: #ff0000;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.hud-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .hud-top-controls {
        top: 0.75rem;
        left: 0.75rem;
    }

    .hud-side-controls {
        right: 0.75rem;
    }

    .hud-bottom-controls {
        bottom: 1rem;
    }

    .hud-view-toggle {
        bottom: 1rem;
        right: 1rem;
    }

    .hud-camera-button {
        width: 3.5rem;
        height: 3.5rem;
    }

    .hud-camera-icon {
        width: 1.75rem;
        height: 1.75rem;
    }

    .hud-mode-button {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    .hud-mode-icon {
        width: 1rem;
        height: 1rem;
    }

    .hud-icon-button {
        width: 2.25rem;
        height: 2.25rem;
    }

    .hud-icon {
        width: 1.125rem;
        height: 1.125rem;
    }
}
/* Calib */
.calib-menu-toggle {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.calib-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.1.5);
}

.calib-menu-item {
    color: white;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.calib-menu-item:hover {
    background: rgba(0, 0, 0, 0.2);
}
.calib-menu-item .active {
    border: #c00;
    color: #c00;
    background: rgb(245, 87, 87);
}

/* =================== ELEGANT MODAL STYLES =================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.elegant-modal {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 400px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    position: relative;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 28px 20px;
    border-bottom: none;
}

.modal-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.modal-title.error {
    color: #ef4444;
}

.modal-close {
    background: #f8fafc;
    border: none;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #334155;
    transform: scale(0.95);
}

.modal-body {
    padding: 8px 28px 32px;
    text-align: center;
}

.modal-text {
    font-size: 1rem;
    color: #334155;
    line-height: 1.6;
    margin: 0 0 28px 0;
    font-weight: 400;
}

.error-icon {
    margin: 0 auto 24px;
    width: 56px;
    height: 56px;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.screenshot-preview {
    max-width: 100%;
    max-height: 350px;
    border-radius: 16px;
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    border: 1px solid #f1f5f9;
}

.modal-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.elegant-button {
    padding: 14px 28px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    min-width: 120px;
    font-family: inherit;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.elegant-button.primary {
    background: linear-gradient(135deg, #ff0000 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(255, 0, 0, 0.3);
}

.elegant-button.primary:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(255, 0, 0, 0.4);
}

.elegant-button.secondary {
    background: #f8fafc;
    color: #475569;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

.elegant-button.secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.1);
}

/* Mobile optimizations for modals */
@media (max-width: 768px) {
    .elegant-modal {
        width: calc(100vw - 32px);
        max-width: none;
        border-radius: 16px;
    }

    .modal-header {
        padding: 24px 24px 16px;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 8px 24px 28px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 12px;
    }

    .elegant-button {
        width: 100%;
        padding: 16px 24px;
        min-width: auto;
    }

    .screenshot-preview {
        max-height: 280px;
    }

    .error-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 20px;
    }
}
