/* css/ui-framework.css */

/* =========================================
   UI FRAMEWORK: SHELL, BUTTONS, MODALS
   ========================================= */

/* --- 1. HEADER & BRANDING (Legacy Page Titles) --- */
/* Note: We exclude .app-header so this style doesn't break the new Global Nav */
header:not(.app-header) {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 0 30px 0; margin-bottom: 40px;
    border-bottom: 1px solid transparent;
    background-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    background-size: 100% 1px; background-repeat: no-repeat; background-position: bottom;
    position: relative;
}

.crest {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--accent-primary, #ff3d6b), var(--accent-secondary, #7c5cff));
    border-radius: 14px; display: flex; align-items: center; justify-content: center;
    font-family: 'Oxanium', sans-serif; font-weight: 900; font-size: 22px; color: white; letter-spacing: -1px;
    box-shadow: 0 10px 20px -5px rgba(124, 92, 255, 0.4), inset 0 0 0 1px rgba(255,255,255,0.2);
    border: 1px solid rgba(255, 255, 255, 0.1); flex-shrink: 0;
}

.header-branding { display: flex; align-items: center; gap: 20px; text-decoration: none; }

h1 {
    font-family: 'Oxanium', sans-serif; font-weight: 800; font-size: 36px; margin: 0 0 2px 0;
    text-transform: uppercase; letter-spacing: -1px;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.5));
}

.lead {
    font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted);
    font-weight: 500; letter-spacing: 1px; text-transform: uppercase; opacity: 0.8;
}

/* --- MOBILE HEADER & BUTTON FIX --- */
@media (max-width: 768px) {
    header:not(.app-header) { 
        flex-direction: column; 
        align-items: center; 
        gap: 16px; 
        margin-bottom: 20px;
    }
    
    .header-branding { justify-content: center; width: 100%; }
    h1 { font-size: 24px; }
    
    .top-actions {
        width: 100%; display: flex; justify-content: center; align-items: center;
        gap: 6px; flex-wrap: nowrap !important;
    }

    .btn, .btn-ghost, .live {
        padding: 8px 10px !important; font-size: 11px !important; 
        border-radius: 8px !important; white-space: nowrap; 
        min-height: 34px; flex-shrink: 1;
    }

    .crest { width: 40px; height: 40px; font-size: 16px; border-radius: 10px; }
    .live span { margin-right: 2px; }
}

/* --- 2. BUTTONS & ACTIONS --- */
.action-group { display: inline-flex; gap: 10px; align-items: center; }
.top-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* Base Button */
.btn, .top-actions .btn {
    padding: 10px 20px; border-radius: 10px; border: 1px solid var(--control-border);
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255, 255, 255, 0.01));
    color: var(--text); cursor: pointer; font-weight: 700; font-family: 'Oxanium', sans-serif;
    letter-spacing: 0.5px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover, .top-actions .btn:hover { 
    transform: translateY(-2px); background: rgba(255,255,255,0.07); 
    border-color: rgba(255,255,255,0.2); box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}
.btn.active { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.4); }

/* Ghost Button */
.btn-ghost { 
    background: transparent; border: 1px solid rgba(255, 255, 255, 0.1); 
    padding: 10px 18px; border-radius: 10px; color: var(--muted); 
    cursor: pointer; font-weight: 700; font-family: 'Oxanium', sans-serif;
    transition: all 0.2s ease;
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: white; border-color: rgba(255,255,255,0.3); }

/* Live Button */
.live, .btn.live {
    background: var(--live); padding: 10px 16px; border-radius: 12px;
    color: #081018; font-weight: 900; border: none;
    box-shadow: 0 0 20px rgba(255, 61, 107, 0.3); animation: pulse 2.6s infinite;
    font-family: 'Oxanium', sans-serif; display: flex; align-items: center; gap: 8px;
}
.live.disabled { opacity: 0.7; pointer-events: none; filter: grayscale(0.1); animation: none; }

/* =========================================
   COMMAND DECK (Nav Cards)
   ========================================= */
.nav-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    max-width: 600px; margin: 0 auto 30px auto; position: relative; z-index: 10;
}

.nav-card {
    display: flex; align-items: center; gap: 14px; text-decoration: none;
    padding: 12px 20px; border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative; overflow: hidden;
}

.nav-card:hover { transform: translateY(-2px); background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.3); }

.nav-icon { font-size: 24px; line-height: 1; filter: drop-shadow(0 0 8px currentColor); flex-shrink: 0; }
.nav-text-col { display: flex; flex-direction: column; justify-content: center; }
.nav-title { font-family: 'Oxanium', sans-serif; font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: #fff; line-height: 1.2; }
.nav-sub { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); opacity: 0.7; line-height: 1.2; }

.nav-card.pantheon { color: var(--accent2); } 
.nav-card.pantheon:hover { box-shadow: inset 0 0 20px rgba(124, 92, 255, 0.1); border-color: var(--accent2); }
.nav-card.bounty { color: #4ade80; }
.nav-card.bounty:hover { box-shadow: inset 0 0 20px rgba(74, 222, 128, 0.1); border-color: #4ade80; }

@media (max-width: 768px) {
    .nav-grid { grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 10px; margin-bottom: 25px; }
    .nav-card { padding: 8px 8px; gap: 8px; justify-content: center; }
    .nav-icon { font-size: 18px; filter: drop-shadow(0 0 5px currentColor); }
    .nav-text-col { min-width: 0; flex: 1; align-items: flex-start; }
    .nav-title { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; line-height: 1.1; }
    .nav-sub { display: none; }
}

/* --- 3. INPUTS & CONTROLS --- */
.controls {
    display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 40px; align-items: flex-end;
    background: var(--glass-heavy); border: 1px solid var(--control-border);
    box-shadow: var(--shadow-premium), inset 0 1px 0 rgba(255,255,255,0.05);
    padding: 24px; border-radius: 16px; backdrop-filter: blur(20px);
}

.select { display: flex; flex-direction: column; gap: 10px; position: relative; min-width: 180px; flex: 1; }
.select label { font-family: 'JetBrains Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); font-weight: 700; margin-left: 4px; }
.select select {
    appearance: none; -webkit-appearance: none; width: 100%;
    background-color: rgba(0,0,0,0.3); border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px; padding: 14px 18px; padding-right: 40px; 
    color: var(--text); font-family: 'Oxanium', sans-serif; font-size: 14px; font-weight: 600;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239aa4b2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
    transition: all 0.2s ease;
}
.select select:focus {
    border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(255, 61, 107, 0.25);
    background-color: rgba(0,0,0,0.5);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ff3d6b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

#resetFilters {
    height: 48px; padding: 0 28px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255,255,255,0.02);
    color: var(--muted); font-family: 'Oxanium', sans-serif; font-weight: 700; font-size: 13px;
    text-transform: uppercase; cursor: pointer; display: flex; align-items: center; gap: 8px; justify-content: center;
}
#resetFilters:hover { background: rgba(239, 68, 68, 0.1) !important; border-color: rgba(239, 68, 68, 0.4) !important; color: #ef4444 !important; }

@media (max-width: 900px) {
    .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; align-items: end; }
    .select { min-width: 0; gap: 6px; }
    .select select { font-size: 12px; padding: 10px 12px; height: 40px; border-radius: 8px; background-position: right 10px center; }
    .select label { font-size: 9px; margin-left: 0; }
    .spacer { display: none; }
    #resetFilters { grid-column: 1 / -1; width: 100%; height: 36px; margin-top: 5px; font-size: 11px; }
}

/* --- 4. MODALS & FORMS --- */
.modal-bg { 
    position: fixed; inset: 0; display: none; 
    align-items: center; justify-content: center; 
    background: rgba(0, 0, 0, 0.8); 
    
    /* CRITICAL CHANGE: Higher Z-Index to stay above Fixed Navigation */
    z-index: 2100; 
    
    backdrop-filter: blur(8px); padding: 20px;
}

.modal { 
    width: 100%; max-width: 440px; padding: 32px; border-radius: 20px; 
    background: linear-gradient(180deg, #10151a, #0b0c0f); 
    border: 1px solid rgba(255, 255, 255, 0.08); 
    box-shadow: 0 50px 80px -20px rgba(0, 0, 0, 0.9); 
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h3 {
    font-family: 'Oxanium', sans-serif; font-size: 24px; font-weight: 700; text-transform: uppercase;
    color: #fff; text-align: center; margin: 0 0 24px 0; letter-spacing: 1px;
    background: linear-gradient(180deg, #fff, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.field { margin-bottom: 16px; position: relative; }
.modal input, .modal select { 
    width: 100%; padding: 14px 16px; border-radius: 10px; 
    border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(0, 0, 0, 0.4);
    color: var(--text); font-family: inherit; font-size: 15px; transition: all 0.2s ease;
}
.modal input:focus, .modal select:focus { 
    outline: none; border-color: var(--accent); background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 4px rgba(255, 61, 107, 0.15);
}
.modal input::placeholder { color: rgba(255, 255, 255, 0.3); }

/* Modal Buttons (Solid Accent) */
.modal .btn { background: var(--accent); color: white; border: none; box-shadow: 0 4px 15px rgba(255, 61, 107, 0.3); }
.modal .btn:hover { background: #ff5c8d; box-shadow: 0 8px 25px rgba(255, 61, 107, 0.5); border-color: transparent; }
.modal .row { display: flex; gap: 12px; margin-top: 24px; }
.modal .row button { flex: 1; }

.terms-wrap { display: flex; align-items: flex-start; gap: 12px; margin: 20px 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.terms-wrap input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; width: 20px; height: 20px; flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.2); border-radius: 5px; background: rgba(0,0,0,0.5);
    cursor: pointer; position: relative; margin-top: 1px; transition: all 0.2s;
}
.terms-wrap input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px rgba(255, 61, 107, 0.4); }
.terms-wrap input[type="checkbox"]:checked::after { content: '✓'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-size: 12px; font-weight: 900; }
.terms-link { color: #fff; text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,0.4); }
.terms-link:hover { border-bottom-style: solid; color: var(--accent); border-color: var(--accent); }

.modal a#resendVerification { font-size: 12px; color: var(--muted); font-family: 'JetBrains Mono', monospace; transition: 0.2s; border-bottom: 1px solid transparent; }
.modal a#resendVerification:hover { color: #fff; border-bottom-color: #fff; }

.error-msg { 
    margin-top: 16px; color: #ff5c5c; font-size: 13px; font-weight: 700; 
    text-align: center; background: rgba(255, 92, 92, 0.1); 
    padding: 10px; border-radius: 8px; border: 1px solid rgba(255, 92, 92, 0.2);
    display: none; 
}
.error-msg:not(:empty) { display: block; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; padding-bottom: 40px; }
.page-btn { background: transparent; border: 1px solid rgba(255, 255, 255, 0.08); padding: 10px 16px; border-radius: 8px; color: var(--muted); cursor: pointer; transition: 0.2s; }
.page-btn:hover { background: rgba(255,255,255,0.05); color: white; }
.page-btn.active { color: white; border-color: var(--accent); background: rgba(255,61,107,0.15); box-shadow: 0 0 15px rgba(255, 61, 107, 0.2); }

/* =========================================
   5. VISUAL SHELL & FOOTER
   ========================================= */

/* Background Grid */
.bg-grid {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px; z-index: -1; pointer-events: none;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

/* Ticker */
.ticker-wrap {
  position: relative; display: flex; align-items: center; overflow: hidden; width: 100%; height: 44px; margin-bottom: 30px;
  background: var(--glass); border-block: 1px solid var(--control-border); backdrop-filter: blur(5px);
  -webkit-mask: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  mask: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.ticker-move {
  display: inline-block;
  white-space: nowrap;
  font: 500 13px/1 'Oxanium', sans-serif;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);

  animation-name: ticker-infinite;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: var(--ticker-duration, 80s);
}

@media (hover: hover) { .ticker-move:hover { animation-play-state: paused; } }

.ticker-item { display: inline-block; padding: 0 3rem; position: relative; }
.ticker-item::after { content: '❖'; position: absolute; top: 50%; right: 0; transform: translateY(-50%); color: var(--accent2); font-size: 10px; opacity: 0.5; }

.ticker-item .t-live { color: var(--accent); font-weight: 800; text-shadow: 0 0 8px rgba(255, 61, 107, 0.6); }
.ticker-item .t-accent { color: var(--accent2); font-weight: 700; }
.ticker-item .t-gold { color: #fbbf24; font-weight: 700; text-shadow: 0 0 5px rgba(251, 191, 36, 0.4); }
.ticker-item .t-val { color: white; font-weight: 700; }

@keyframes ticker-infinite {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(var(--ticker-distance), 0, 0); }
}

/* Global Footer */
.app-footer {
    margin-top: 60px; padding: 40px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); text-align: center;
}

/* Ensure footer isn't hidden behind bottom nav on mobile */
@media (max-width: 768px) {
    .app-footer { padding-bottom: 100px; }
}

.footer-nav { display: flex; justify-content: center; gap: 30px; margin-bottom: 15px; flex-wrap: wrap; }
.footer-link {
    font-family: 'Oxanium', sans-serif; color: #a1a1aa; text-decoration: none; 
    font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; transition: all 0.2s ease;
}
.footer-link:hover { color: #ffffff; text-shadow: 0 0 10px rgba(255, 255, 255, 0.4); }
.copyright { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #52525b; }


/* =========================================
   Cities Search Result
   ========================================= */


.autocomplete-wrapper { position: relative; width: 100%; }
.results-list {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 99;
    max-height: 250px;
    overflow-y: auto;
}
.result-item {
    padding: 12px;
    cursor: pointer;
    font-size: 14px;
}
.result-item:hover { background: #f4f4f4; }