body {
    margin: 0;
    font-family: sans-serif;
    background: #04070d;
    color: white;
    overflow: hidden;
    touch-action: manipulation;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.hidden {
    display: none !important;
}

.back-to-menu-btn,
.secondary-action {
    position: absolute;
    top: 20px;
    z-index: 300;
    padding: 8px 16px;
    background-color: rgba(0, 0, 0, 0.55);
    color: white;
    text-decoration: none;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s, transform 0.3s;
    min-height: 44px;
    touch-action: manipulation;
}

.back-to-menu-btn {
    right: 20px;
}

.secondary-action {
    left: 20px;
}

.back-to-menu-btn:hover,
.secondary-action:hover {
    background-color: rgba(0, 0, 0, 0.8);
    border-color: white;
    transform: translateY(-1px);
}

.drone-overview {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    padding: 0;
    box-sizing: border-box;
    background:
        radial-gradient(circle at top right, rgba(32, 83, 179, 0.22), transparent 30%),
        radial-gradient(circle at bottom left, rgba(13, 194, 176, 0.16), transparent 32%),
        linear-gradient(135deg, #07111f 0%, #0c172a 45%, #05090f 100%);
}

.overview-card {
    width: 100%;
    height: 66.666%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex: 0 0 66.666%;
}

.overview-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
    object-position: top center;
    display: block;
}

.drone-entry-button {
    position: absolute;
    background: transparent;
    border: 1px solid transparent;
    padding: 0;
    cursor: pointer;
    touch-action: none;
}

.drone-entry-button:focus-visible {
    outline: 2px dashed rgba(255, 255, 255, 0.7);
    outline-offset: 4px;
}

.drone-overview.config-mode .drone-entry-button {
    border-color: rgba(255, 0, 0, 0.85);
    background: rgba(255, 0, 0, 0.05);
    cursor: move;
}

.overview-config-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 320;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    background: rgba(8, 16, 31, 0.88);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    min-height: 48px;
    min-width: 168px;
    touch-action: manipulation;
}

.overview-config-btn:hover {
    background: rgba(12, 24, 45, 0.96);
    border-color: rgba(255, 255, 255, 0.5);
}

.overview-config-panel {
    position: fixed;
    right: 20px;
    bottom: 72px;
    z-index: 330;
    width: min(380px, calc(100vw - 32px));
    max-height: min(70vh, 720px);
    overflow-y: auto;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(8, 16, 31, 0.96);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.overview-config-panel h2,
.overview-config-panel h3 {
    margin: 0;
}

.overview-config-panel h2 {
    margin-bottom: 14px;
    font-size: 18px;
}

.config-section + .config-section {
    margin-top: 16px;
}

.config-section h3 {
    margin-bottom: 10px;
    font-size: 15px;
}

.config-section label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.config-section select,
.config-section input {
    width: 100%;
    margin-top: 6px;
    box-sizing: border-box;
    padding: 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-size: 16px;
    min-height: 48px;
    touch-action: manipulation;
    user-select: text;
    -webkit-user-select: text;
}

.config-section select {
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000;
    color-scheme: light;
}

.config-section select option {
    background: #ffffff !important;
    color: #000000 !important;
}

.config-section select optgroup {
    background: #ffffff !important;
    color: #000000 !important;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.config-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.config-actions button {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    cursor: pointer;
    min-height: 48px;
    touch-action: manipulation;
}

#config-save-btn {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.overview-video-panel {
    width: 100%;
    height: 33.334%;
    flex: 0 0 33.334%;
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-height: 0;
}

.overview-video {
    width: 100%;
    height: 100%;
    border-radius: 0;
    background: #000;
    object-fit: cover;
    box-shadow: none;
    display: block;
}

.selected-drone-name {
    position: absolute;
    top: 72px;
    left: 50%;
    z-index: 250;
    transform: translateX(-50%);
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brochure-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background-color: #04070d;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.hotspot {
    position: absolute;
    cursor: pointer;
    border: 2px dashed transparent;
    background: transparent;
    padding: 0;
    touch-action: none;
}

.brochure-container.config-mode .hotspot {
    border-color: rgba(255, 74, 74, 0.85);
    background: rgba(255, 74, 74, 0.06);
    cursor: move;
}

#video-popup {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 400;
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

#video-popup.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.popup-content {
    position: relative;
    width: 80%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
}

#video-player {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: black;
}

#close-popup {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 30px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
}

@media (max-width: 900px) {
    .drone-overview {
        gap: 0;
        padding: 0;
    }

    .overview-image {
        max-height: none;
    }

    .selected-drone-name {
        top: 122px;
    }
}

@media (max-width: 640px) {
    .back-to-menu-btn,
    .secondary-action {
        font-size: 14px;
        padding: 10px 14px;
    }

    .drone-overview {
        gap: 0;
        padding: 0;
    }

    .overview-image {
        max-height: none;
    }

    .overview-video {
        border-radius: 0;
    }

    .overview-config-btn {
        right: 12px;
        bottom: 12px;
        font-size: 14px;
        padding: 10px 14px;
        min-width: 150px;
    }

    .overview-config-panel {
        right: 12px;
        bottom: 58px;
        width: min(360px, calc(100vw - 24px));
        padding: 14px;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .popup-content {
        width: 92%;
    }
}
