/* ==========================================
   🧩 V7.12 REUSABLE COMPONENTS
   ========================================== */

/* --- INPUTS & FORMS --- */
.modern-input, .modern-select {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 16px !important; /* CRITICAL: Prevents iOS from zooming in on focus */
    font-weight: 600;
    color: #fff;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-input);
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin: 0;
    margin-bottom: 10px;
}

.modern-input:focus, .modern-select:focus {
    border-color: var(--color-neon-blue);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
    background: rgba(15, 23, 42, 0.9);
}

.modern-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
    cursor: pointer;
}

.modern-select option {
    background: #0f172a;
    color: #fff;
    font-size: 1rem;
    padding: 10px;
}

/* --- COMPACT FLAG SELECTOR GRID --- */
.flag-selection {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.flag-card {
    background: rgba(15, 23, 42, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1.5rem;
    padding: 6px 8px; 
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    font-family: 'Apple Color Emoji', 'Noto Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.flag-card:hover {
    border-color: var(--color-neon-blue);
    background: rgba(56, 189, 248, 0.1);
    transform: translateY(-2px);
}

.flag-card.selected {
    border-color: var(--color-neon-blue);
    background: rgba(56, 189, 248, 0.25);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
    transform: scale(1.1);
}

/* --- ROLE CARDS --- */
.role-selection { display: flex; gap: 12px; margin-bottom: 15px; justify-content: center; }
.role-card { 
    background: rgba(255, 255, 255, 0.05); border: 2px solid rgba(255, 255, 255, 0.1); 
    border-radius: 20px; padding: 12px 10px; cursor: pointer; 
    width: 30%; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); user-select: none; 
}
.role-card:hover { border-color: #88ccff; transform: translateY(-4px); background: rgba(255, 255, 255, 0.1); }
.role-card.selected { 
    border-color: var(--color-secondary); background: rgba(77, 159, 255, 0.2); 
    transform: scale(1.05) translateY(-4px); box-shadow: 0 10px 20px rgba(77, 159, 255, 0.3); 
}
.role-emoji { font-size: 2rem; margin-bottom: 6px; }
.role-text { font-size: 0.85rem; font-weight: 800; color: #fff; }

/* --- 3D TACTILE BUTTONS --- */
button {
    border-radius: var(--radius-btn) !important; font-weight: 800 !important;
    transition: all 0.15s ease !important; font-family: 'Nunito', sans-serif;
    cursor: pointer; touch-action: manipulation;
}
button:hover { transform: translateY(2px); }
button:active { transform: translateY(4px); }

#btn-enter-universe { 
    background: var(--color-primary) !important; color: #1E1B4B !important; border: none; 
    padding: 16px 35px; font-size: 1.25rem; 
    box-shadow: 0 6px 0 var(--color-primary-shadow), 0 15px 25px rgba(255, 209, 102, 0.2); 
}
#btn-enter-universe:hover:not(:disabled) { transform: translateY(2px); box-shadow: 0 4px 0 var(--color-primary-shadow), 0 10px 20px rgba(255, 209, 102, 0.3); }
#btn-enter-universe:not(:disabled):active { box-shadow: 0 0 0 var(--color-primary-shadow) !important; transform: translateY(6px); }
#btn-enter-universe:disabled { background: #444 !important; color: #777 !important; cursor: not-allowed; box-shadow: none !important; transform: none !important; }

button.action-btn, #btn-save-profile, #download-cert-btn, #mythology-btn { 
    background: var(--color-primary) !important; color: #1E1B4B !important; border: none !important; 
    box-shadow: 0 4px 0 var(--color-primary-shadow), 0 8px 15px rgba(255, 209, 102, 0.3) !important;
}
button.action-btn:active, #btn-save-profile:active, #download-cert-btn:active, #mythology-btn:active { 
    box-shadow: 0 0 0 var(--color-primary-shadow) !important; transform: translateY(4px);
}

#observatory-btn, #btn-share, #btn-quiz-start {
    background: var(--color-secondary) !important; color: #fff !important; border: none;
    box-shadow: 0 4px 0 var(--color-secondary-shadow), 0 8px 15px rgba(77, 159, 255, 0.3) !important;
}
#observatory-btn:active, #btn-share:active, #btn-quiz-start:active { box-shadow: 0 0 0 var(--color-secondary-shadow) !important; transform: translateY(4px); }

#btn-quiz-exit { background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.2); color: #fff; padding: 10px 20px; }
#btn-quiz-exit:hover { background: #ff4422; border-color: #ff4422; box-shadow: 0 0 15px rgba(255,68,34,0.4); }
#btn-cancel-edit, #btn-edit-profile { background: rgba(255,255,255,0.1); color: #fff; border: 2px solid rgba(255,255,255,0.2); }
#btn-cancel-edit:hover, #btn-edit-profile:hover { background: rgba(255,255,255,0.2); }

#reset-btn, #observatory-btn, #mythology-btn, #dome-btn { width: 100% !important; padding: 12px !important; margin-top: 10px !important; font-size: 1rem !important; }

/* --- TIME CONTROLS --- */
.time-btn { 
    background: rgba(255, 255, 255, 0.1) !important; color: white; 
    border: 2px solid rgba(255, 255, 255, 0.2) !important; border-radius: 50% !important; 
    width: 50px !important; height: 50px !important; font-size: 1.3rem; 
    display: flex; align-items: center; justify-content: center; box-shadow: none !important;
}
.time-btn:hover { background: rgba(255, 255, 255, 0.2) !important; transform: scale(1.1) !important; }
.time-btn.active { background: #FF477E !important; color: #fff !important; border-color: #FF477E !important; box-shadow: 0 0 15px rgba(255, 71, 126, 0.5) !important; }

/* --- 🚀 UNIVERSAL TASKBAR & DOCK PANELS --- */
.universal-taskbar {
    display: flex; position: fixed;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 600px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1); border-bottom: none;
    border-radius: 24px 24px 0 0;
    z-index: 10000; justify-content: space-around;
    padding: 12px 20px;
    padding-bottom: env(safe-area-inset-bottom, 15px);
    transition: opacity 0.3s ease-in-out;
}

.nav-item {
    display: flex; flex-direction: column; align-items: center;
    color: #94a3b8; background: none; border: none; box-shadow: none !important;
    cursor: pointer; transition: 0.2s; font-family: 'Nunito', sans-serif;
    width: 60px; padding: 0 !important;
}
.nav-item:hover { transform: none; }
.nav-item .icon { font-size: 1.5rem; margin-bottom: 4px; transition: 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.nav-item .nav-label { font-size: 0.75rem; font-weight: 800; }
.nav-item.active { color: #00ffcc; }
.nav-item.active .icon { transform: translateY(-4px) scale(1.15); }

/* The Centered Docked Panels (Replaces Old Panel Base) */
.panel-base { 
    position: fixed !important;
    top: auto !important; left: 50% !important; bottom: 85px !important;
    transform: translateX(-50%) translateY(150%) !important;
    width: 95% !important; max-width: 450px !important;
    background: rgba(15, 23, 42, 0.75) !important; 
    backdrop-filter: blur(24px) !important; -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important; border-top: 2px solid rgba(255, 255, 255, 0.2) !important; 
    border-radius: 24px !important; margin: 0 !important;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s !important;
    max-height: 65vh; overflow-y: auto; overflow-x: hidden; opacity: 0 !important;
    pointer-events: none; z-index: 10;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 2px 10px rgba(255,255,255,0.05) !important;
}

/* ❌ UNIVERSAL PANEL CLOSE BUTTON */
.panel-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #94A3B8;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
}

.panel-close-btn:hover {
    background: #FF477E; 
    color: #fff;
    border-color: #FF477E;
    transform: scale(1.1) rotate(90deg); 
    box-shadow: 0 4px 10px rgba(255, 71, 126, 0.3);
}

.panel-close-btn:active {
    transform: scale(0.95);
}

.docked-sheet-active {
    transform: translateX(-50%) translateY(0) !important;
    opacity: 1 !important; pointer-events: auto !important;
}

/* Nuke all legacy drag logic & headers */
.panel-header, .drag-handle-zone, .minimize-btn, .collapsed-content { display: none !important; }
.panel-base.collapsed { padding-bottom: 0px !important; }

/* --- ⬅️ ➡️ GIANT PRESENTATION ARROWS --- */
.smartboard-nav {
    display: none; position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.8); color: #88ccff; border: 2px solid #88ccff;
    border-radius: 50%; width: 80px; height: 80px; font-size: 3rem; cursor: pointer; z-index: 2000; 
    align-items: center; justify-content: center; box-shadow: 0 0 20px rgba(136, 204, 255, 0.3); 
    backdrop-filter: blur(10px); transition: 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); user-select: none;
}
.smartboard-nav:hover { background: #88ccff; color: #000; box-shadow: 0 0 30px rgba(136, 204, 255, 0.6); transform: translateY(-50%) scale(1.1); }
#nav-left { left: 30px; }
#nav-right { right: 30px; }

/* ==========================================
   🗜️ DESKTOP COMPRESSION OVERRIDES
   ========================================== */
@media (min-width: 769px) {
    .modern-input, .modern-select {
        padding: 10px 16px; 
        margin-bottom: 5px; 
    }
    .flag-selection {
        margin-bottom: 8px; 
    }
    .role-selection {
        margin-bottom: 10px; 
    }
    .role-card {
        padding: 8px 10px; 
    }
    .role-emoji { 
        font-size: 1.6rem; 
        margin-bottom: 4px; 
    }
}

/* --- MOBILE TWEAKS --- */
@media (max-width: 768px) {
    #btn-enter-universe { padding: 12px 25px; font-size: 1.1rem; width: 100%; }
    .time-btn { width: 44px !important; height: 44px !important; font-size: 1rem; }
    .universal-taskbar { max-width: 100%; border-radius: 0; border-left: none; border-right: none; }
}

@media (max-width: 950px) and (orientation: landscape) {
    .panel-base { max-height: 60vh; }
}
