/* ===== PILOTS HOUSE SECTION STYLES (MATCHING ISLAND BREAKPOINTS) ===== */

#pilots-section {
    background: #000;
}

/* ===== FIXED ACTION BUTTONS ===== */

/* BTQ360 Button */
#pilots-btq-button {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 2000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    pointer-events: all;
    opacity: 1;
}

#pilots-btq-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

#pilots-btq-button.hidden {
    opacity: 0;
    pointer-events: none;
}

.btq-icon {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.btq-icon:hover {
    opacity: 1;
}

/* UI Toggle Button */
#pilots-ui-toggle-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.4s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 1;
    pointer-events: all;
}

#pilots-ui-toggle-button:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

/* Desktop: Move toggle button above UI when panel is open */
#pilots-ui-toggle-button.panel-open {
    bottom: 180px;
    transition: bottom 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== DESKTOP UI PANEL ===== */

#pilots-ui-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(25px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1500;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 20px 30px;
    padding-left: calc(30px + 180px + 30px); /* Space for house image */
    gap: 30px;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#pilots-ui-panel.visible {
    transform: translateY(0);
}

/* Panel Content Layout */
#pilots-ui-panel .panel-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 250px;
}

#pilots-ui-panel .panel-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

#pilots-ui-panel .panel-description {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.8);
}

#pilots-ui-panel .read-more-button {
    display: none; /* Hidden on desktop */
}

/* Location Details Grid */
#pilots-ui-panel .location-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    min-width: 280px;
    flex: 1;
    flex-shrink: 0;
}

#pilots-ui-panel .detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#pilots-ui-panel .detail-label {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 9px;
    white-space: nowrap;
}

#pilots-ui-panel .detail-value {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-weight: 400; /* Much lighter for Safari compatibility */
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
}

/* Safari-specific font weight fix */
@supports (-webkit-appearance: none) {
    #pilots-ui-panel .detail-value {
        font-weight: 300; /* Even lighter for Safari */
        font-family: 'Roboto Mono', 'Inconsolata', 'Monaco', monospace; /* Different font order for Safari */
    }
}

/* Control Buttons Section */
#pilots-ui-panel .controls-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

#pilots-ui-panel .control-group {
    display: flex;
    gap: 12px;
}

#pilots-ui-panel .control-button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#pilots-ui-panel .control-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

#pilots-ui-panel .control-button.active {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Control Icons */
#pilots-ui-panel .auto-rotate-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

#pilots-ui-panel .control-button:hover .auto-rotate-icon {
    opacity: 1;
}

#pilots-ui-panel .nav-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: all 0.3s ease;
}

#pilots-ui-panel .control-button:hover .nav-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* ===== STANDALONE NAVIGATION BUTTONS (WHEN UI IS HIDDEN) ===== */

.standalone-nav-buttons {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1400; /* Below UI panel but above other elements */
    display: flex;
    gap: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.standalone-nav-buttons.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.standalone-nav-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    pointer-events: all;
}

.standalone-nav-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.08);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

.standalone-nav-button:active {
    transform: scale(0.98);
}

.standalone-nav-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.standalone-nav-button:hover .standalone-nav-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* ===== DESKTOP HOUSE IMAGE CONTAINER ===== */

.house-container {
    position: fixed;
    bottom: 20px;
    left: 30px;
    width: 180px;
    height: 135px; /* 180px * 0.75 to maintain aspect ratio */
    z-index: 1600;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none;
    overflow: hidden;
}

.house-container.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.house-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    opacity: 0.95;
}

/* ===== MOBILE RESPONSIVE STYLES (1024px and below - MATCHING ISLAND) ===== */

@media (max-width: 1024px) {
    
    /* Mobile UI Panel - MATCHING ISLAND EXACTLY */
    #pilots-ui-panel {
        height: auto !important;
        max-height: 65vh !important;
        min-height: 280px !important;
        flex-direction: column;
        padding: 0;
        gap: 0;
        background: rgba(0, 0, 0, 0.2);
        padding-left: 0;
        align-items: stretch;
        justify-content: flex-start;
        overflow: visible !important;
        padding-bottom: 20px;
    }

    /* Mobile House Container - POSITIONED LIKE ISLAND MAP */
    .house-container {
        position: fixed !important;
        bottom: 300px !important; /* Higher position to avoid overlap */
        left: 50% !important; /* Centered horizontally */
        transform: translateX(-50%) !important;
        width: 160px !important; /* Slightly smaller for mobile */
        height: 120px !important; /* Maintain aspect ratio */
        background: none !important;
        border: none !important;
        border-radius: 8px !important; /* Add slight rounding */
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 1600 !important;
        pointer-events: none !important;
        overflow: hidden !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.3s ease !important;
    }

    .house-container.visible.positioned {
        opacity: 1 !important;
        visibility: visible !important;
    }

    .house-image {
        width: 100% !important;
        height: 100% !important;
        border-radius: 8px !important; /* Match container rounding */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important; /* Softer shadow */
        border: none !important;
        background: none !important;
        opacity: 0.9 !important;
        object-fit: cover !important;
    }

    /* Mobile Panel Content - REDUCED TOP PADDING & LEFT ALIGNED */
    #pilots-ui-panel .panel-header {
        order: 1;
        padding: 60px 20px 16px 20px !important; /* Same as island */
        text-align: left !important;
        min-width: auto;
        flex: none;
    }

    #pilots-ui-panel .panel-title {
        font-size: 18px;
        margin-bottom: 8px;
        line-height: 1.2;
    }

    #pilots-ui-panel .panel-description {
        font-size: 11px !important;
        line-height: 1.3;
        max-width: 100%;
        transition: all 0.3s ease;
        /* Always show full text on mobile - no collapsing */
    }

    /* Hide read-more button on mobile */
    #pilots-ui-panel .read-more-button {
        display: none !important;
    }

    /* Mobile Location Details */
    #pilots-ui-panel .location-details {
        order: 2;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 10px 12px;
        margin: 0 20px;
        min-width: auto;
        flex: none;
        background: rgba(255, 255, 255, 0.08);
        width: calc(100% - 40px);
    }

    #pilots-ui-panel .detail-item {
        gap: 2px;
    }

    #pilots-ui-panel .detail-label {
        font-size: 7px;
        letter-spacing: 0.4px;
    }

    #pilots-ui-panel .detail-value {
        font-size: 9px;
        font-weight: 300; /* Even lighter on mobile */
    }

    /* Safari mobile fix */
    @supports (-webkit-appearance: none) {
        #pilots-ui-panel .detail-value {
            font-weight: 200; /* Very light for Safari mobile */
        }
    }

    /* Mobile Controls */
    #pilots-ui-panel .controls-section {
        order: 3;
        flex-direction: row;
        justify-content: center;
        gap: 12px;
        padding: 12px 20px 16px 20px;
        flex: none;
    }

    #pilots-ui-panel .control-button {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    /* Mobile Action Buttons */
    #pilots-ui-toggle-button {
        bottom: 20px !important;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 14px;
        z-index: 2100;
    }

    #pilots-ui-toggle-button.panel-open {
        bottom: 20px !important; /* Don't move on mobile */
    }

    #pilots-btq-button {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
        z-index: 2100;
    }

    #pilots-btq-button.hidden {
        opacity: 1 !important; /* Stay visible on mobile */
        pointer-events: all !important;
    }

    .btq-icon {
        width: 20px;
        height: 20px;
    }

    /* Mobile Standalone Navigation Buttons */
    .standalone-nav-buttons {
        bottom: 20px;
        gap: 12px;
    }

    .standalone-nav-button {
        width: 45px;
        height: 45px;
    }

    .standalone-nav-icon {
        width: 16px;
        height: 16px;
    }

    /* Mobile Icon Sizing */
    .auto-rotate-icon {
        width: 16px;
        height: 16px;
    }

    .nav-icon {
        width: 12px;
        height: 12px;
    }
}