
/* Ensure Google Translate elements are always above other widgets */
.goog-te-gadget,
.goog-te-gadget-simple,
.goog-te-menu-frame,
.goog-te-combo,
iframe[src*="translate.google.com"],
iframe[src*="translate.googleapis.com"],
#google_translate_element,
.skiptranslate {
    z-index: 10001 !important;
    position: relative !important;
    pointer-events: auto !important;
}

/* Google Translate menu iframe (appears when clicking language selector) */
body > iframe[src*="translate.google"] {
    z-index: 10002 !important;
    pointer-events: auto !important;
}

/* Ensure translate popup is above unified remote AND Gtrado Panel */
#translatePopup {
    z-index: 100000 !important; /* Higher than Gtrado Panel (99999) */
    pointer-events: auto !important;
}

/* Unified remote should be below translate popup */
.unified-remote {
    z-index: 999 !important;
    pointer-events: auto !important;
}

/* ===== Universal Remote - Apply to ALL pages (exact copy from gallery.php) ===== */
/* This makes all pages have identical remote styling */
/* Base CSS from gallery.php */
.floating-remote.unified-remote {
    position: relative !important; /* Will be positioned by Gtrado Panel */
    left: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-height: 400px !important;
    background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 100%) !important;
    backdrop-filter: blur(15px) !important;
    border-radius: 8px !important;
    padding: 6px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    z-index: 1 !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* display, visibility, opacity controlled by inline style + JS toggle */
    flex-direction: column !important;
    pointer-events: auto !important;
    transform: none !important;
    -webkit-transform: none !important;
    margin: 0 !important;
}
.floating-remote.unified-remote.expanded {
    width: 100% !important;
    padding: 6px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}
/* Gallery-specific overrides (exact copy from gallery.php lines 1537-1639) */
.floating-remote.unified-remote {
    padding: 4px !important;
    max-height: 300px !important;
    min-width: auto !important;
}

.floating-remote.unified-remote .remote-content {
    padding: 4px !important;
}

.floating-remote.unified-remote .remote-label {
    display: none !important;
}

.floating-remote.unified-remote .remote-header {
    display: none !important;
}

.floating-remote.unified-remote .remote-section {
    margin-bottom: 4px !important;
}

.floating-remote.unified-remote .power-btn {
    padding: 4px !important;
    font-size: 10px !important;
    min-height: auto !important;
}

.floating-remote.unified-remote .icon-btn {
    padding: 4px !important;
    font-size: 9px !important;
    min-height: auto !important;
}

.floating-remote.unified-remote .service-btn {
    font-size: 10px !important;
    min-height: auto !important;
    min-width: auto !important;
}

.floating-remote.unified-remote .volume-btn,
.floating-remote.unified-remote .channel-btn-remote {
    padding: 3px !important;
    font-size: 8px !important;
    min-height: auto !important;
}

.floating-remote.unified-remote .mute-btn {
    width: 22px !important;
    height: 22px !important;
    font-size: 10px !important;
}

.floating-remote.unified-remote .nav-pad-btn {
    font-size: 9px !important;
    min-height: auto !important;
    min-width: auto !important;
}

.floating-remote.unified-remote .menu-btn {
    padding: 4px !important;
    font-size: 9px !important;
    min-height: auto !important;
}

.floating-remote.unified-remote .playback-btn {
    padding: 4px !important;
    font-size: 10px !important;
    min-height: auto !important;
    min-width: auto !important;
}

.floating-remote.unified-remote .num-btn {
    padding: 4px !important;
    font-size: 8px !important;
    min-height: auto !important;
    min-width: auto !important;
}

.floating-remote.unified-remote .feature-btn {
    padding: 4px !important;
    font-size: 7px !important;
    min-height: auto !important;
}

.floating-remote.unified-remote .feature-btn i {
    font-size: 10px !important;
}

.floating-remote.unified-remote .feature-btn span {
    font-size: 6px !important;
}

.floating-remote.unified-remote .control-label {
    font-size: 6px !important;
}

.floating-remote.unified-remote .remote-header {
    margin-bottom: 4px !important;
    padding-bottom: 2px !important;
}

/* When translate popup is open, ensure unified remote doesn't interfere */
body:has(#translatePopup[style*="display: block"]) .unified-remote {
    pointer-events: none !important;
}

/* Fallback for browsers that don't support :has() */
#translatePopup[style*="display: block"] ~ * .unified-remote,
.translate-popup-open .unified-remote {
    pointer-events: none !important;
}

/* When translate popup is open, ensure Gtrado Panel doesn't interfere */
body:has(#translatePopup[style*="display: block"]) .ufo-control-panel,
body:has(#translatePopup[style*="display: block"]) #ufoControlPanel {
    pointer-events: none !important;
    /* Keep UFO z-index unchanged so it never goes behind the header */
}

/* Fallback for browsers that don't support :has() */
#translatePopup[style*="display: block"] ~ * .ufo-control-panel,
#translatePopup[style*="display: block"] ~ * #ufoControlPanel,
.translate-popup-open .ufo-control-panel,
.translate-popup-open #ufoControlPanel {
    pointer-events: none !important;
    /* Keep UFO z-index unchanged so it never goes behind the header */
}

/* Floating Dock Styles */
.dock-icon-btn {
    color: #111 !important;
}

.dock-icon-btn:hover {
    background:#f0f0f0 !important;
    transform:scale(1.1);
    color: #007bff !important;
}

.dock-icon-btn i {
    transition:all 0.3s;
}

.dock-icon-btn:hover i {
    color:#007bff !important;
}

/* Animate dock on page load */
.floating-dock {
    animation:slideInFromRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInFromRight {
    from {
        transform: translateX(20px) translateZ(0);
        opacity: 0;
    }
    to {
        transform: translateX(0) translateZ(0);
        opacity: 1;
    }
}

/* Responsive - hide on small screens */
@media (max-width: 768px) {
    .floating-dock {
        display:none;
    }
}

/* Sound button toggle */
#soundBtn .fa-volume-high {
    color: #28a745;
}

#soundBtn .fa-volume-xmark {
    color: #dc3545;
}

/* Responsive Layout */
@media (max-width: 1024px) {
    .header-second-row {
        padding: 5px 10px !important;
    }
    
    .header-center {
        gap: 10px !important;
    }
    
    .nav-btn {
        font-size: 14px !important;
        padding: 8px 12px !important;
    }
    
    .floating-dock {
        right: 10px !important;
        top: 120px !important;
    }
}
@media (max-width: 768px) {
    /* Stack Row 2 on mobile */
    .header-second-row {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }
    .header-second-row::-webkit-scrollbar { display: none !important; }
    
    .header-left {
        order: 1;
        width: 100%;
        justify-content: center !important;
        margin-bottom: 10px;
    }
    
    .header-center {
        order: 2;
        width: 100%;
        justify-content: center !important;
        flex-wrap: nowrap !important; /* Force single row */
        gap: 8px !important;
        overflow-x: auto; /* Allow horizontal scroll if needed on very small screens */
    }
    
    .header-right {
        order: 3;
        width: 100%;
        justify-content: center !important;
        margin-top: 10px;
    }
    
    /* Hide floating dock on mobile (use header icons instead) */
    .floating-dock {
        display: none !important;
    }
    
    /* Show smaller icons on mobile */
    .row1-right-icons {
        gap: 10px !important;
    }
    
    .header-icon-btn {
        width: 36px !important;
        height: 36px !important;
    }
    
    .nav-btn {
        font-size: 13px !important;
        padding: 6px 10px !important;
    }
    
    /* Top bar link styling */
    .header-top-bar a {
        text-decoration: none !important;
        color: inherit !important;
        transition: all 0.22s ease !important;
    }
    .header-top-bar a:hover {
        color: #007bff !important;
        transform: translateY(-1px);
    }
    .orders-trigger:hover {
        cursor: pointer !important;
    }
}
@media (max-width: 480px) {
    /* Very small screens */
    .header-center {
        gap: 5px !important;
    }
    
    .nav-btn {
        font-size: 12px !important;
        padding: 5px 8px !important;
    }
    
    .row1-right-icons {
        gap: 8px !important;
    }
}
