:root {
    --bg-gradient: linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%);
    --panel-bg: rgba(15, 23, 42, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #64748b;
    --accent-glow: #6366f1;
    --accent-gradient: linear-gradient(135deg, #6366f1, #a855f7);
    --parallel-color: #f59e0b;
    --official-color: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 50%;
    top: 15%;
    left: 20%;
    filter: blur(100px);
    z-index: -1;
}

.glass-container {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    width: 100%;
    max-width: 500px;
    padding: 35px 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 6px;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Info Summary Cards */
.rate-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 28px;
}

.card {
    background: rgba(8, 12, 24, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.12);
}

.card h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.8px;
}

.card p {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.3px;
}

.card.parallel p { color: var(--parallel-color); }
.card.official p { color: var(--official-color); }

/* Main Forms */
.converter-box {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.input-group, .select-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding-left: 4px;
}

input, .custom-select-trigger {
    background: rgba(8, 12, 24, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 16px;
    border-radius: 16px;
    font-size: 1.05rem;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

input:focus, .custom-select-trigger:hover {
    border-color: var(--accent-glow);
    background: rgba(8, 12, 24, 0.7);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.conversion-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.swap-btn {
    background: var(--accent-gradient);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    margin-bottom: 2px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
}

.swap-btn:hover {
    transform: rotate(180deg) scale(1.05);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* Radio Market Toggles */
.market-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(8, 12, 24, 0.3);
    padding: 10px 14px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
}

.toggle-label { font-size: 0.85rem; color: #94a3b8; font-weight: 600; }
.radio-inputs { display: flex; background-color: rgba(8, 12, 24, 0.7); border: 1px solid rgba(255, 255, 255, 0.03); border-radius: 12px; padding: 4px; width: 250px; }
.radio-option { flex: 1; text-align: center; }
.radio-option input { display: none; }
.radio-option .name { display: flex; cursor: pointer; align-items: center; justify-content: center; border-radius: 9px; padding: 8px 0; color: #94a3b8; font-size: 0.85rem; font-weight: 600; transition: all 0.2s ease; }
.radio-option input:checked + .name { background: var(--text-main); color: #0f172a; font-weight: 700; }

/* Dynamic Calculations Box */
.result-area {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.06) 0%, rgba(168, 85, 247, 0.02) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    margin-top: 5px;
}

#result-text { font-size: 1.45rem; font-weight: 700; margin-bottom: 8px; line-height: 1.3; word-break: break-word; }
#result-text .highlight { background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; }
#rate-timestamp { font-size: 0.78rem; color: var(--text-muted); display: block; line-height: 1.4; }

/* 🔍 DETAILED SEARCH MODAL OVERLAY ENGINE */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 6, 10, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.search-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

#currency-search-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    font-size: 0.95rem;
    border-radius: 14px;
    background: rgba(8, 12, 24, 0.6);
}

.options-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.options-list::-webkit-scrollbar { width: 6px; }
.options-list::-webkit-scrollbar-track { background: transparent; }
.options-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.option-item:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.option-item .currency-code {
    font-weight: 700;
    color: var(--text-main);
    margin-right: 8px;
}

.option-item .currency-name {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.option-item .currency-symbol {
    font-weight: 600;
    color: var(--accent-glow);
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* System Toast Notifications */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-glow);
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast.parallel-toast { border-left-color: var(--parallel-color); }
.toast.official-toast { border-left-color: var(--official-color); }

@keyframes slideIn { to { transform: translateX(0); } }
.toast.fade-out { opacity: 0; transform: translateY(-10px); transition: opacity 0.4s, transform 0.4s; }

/* Mobile View Collapse Rules */
@media (max-width: 440px) {
    .glass-container { padding: 25px 18px; }
    header h1 { font-size: 2rem; }
    .conversion-row { flex-direction: column; align-items: stretch; gap: 15px; }
    .swap-btn { align-self: center; transform: rotate(90deg); }
    .swap-btn:hover { transform: rotate(270deg) scale(1.05); }
    .market-toggle { flex-direction: column; gap: 12px; }
    .radio-inputs { width: 100%; }
    #notification-container { top: auto; bottom: 20px; right: 20px; left: 20px; }
    .modal-content { max-height: 90vh; width: 100%; margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; position: fixed; bottom: 0; }
}
/* ==========================================
   🧭 NEW NAVIGATION TABS & FEES STYLING
   ========================================== */

.tab-navigation {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 6px;
    margin-bottom: 28px;
    gap: 6px;
}

.nav-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    color: #94a3b8; /* Muted text color */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.25s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* When hovering over an inactive tab */
.nav-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
}

/* The active state that highlights which page you are on */
.nav-tab.active {
    background: #ffffff;
    color: #0f172a; /* Dark text for contrast against white background */
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Helper styling to make sure text inputs with icons position perfectly */
.search-wrapper {
    position: relative;
    width: 100%;
}

.search-wrapper input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    height: 50px;
    outline: none;
    transition: all 0.3s ease;
}

.search-wrapper input:focus {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.8);
}
/* Reset and Base Styles matching your design theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #0b0f19;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Master Container matching the layout of 1780633995336.jpeg */
.calculator-container {
    background: linear-gradient(180deg, #131926 0%, #0d121f 100%);
    width: 100%;
    max-width: 410px;
    border-radius: 30px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Nav Tabs */
.tab-container {
    background-color: #090d16;
    display: flex;
    padding: 6px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #7e8b9b;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background-color: #ffffff;
    color: #0b0f19;
}

/* Calculator Screen Display */
.calc-screen {
    background-color: #090d16;
    border-radius: 18px;
    padding: 20px;
    text-align: right;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow-x: auto;
}

.screen-history {
    font-size: 15px;
    color: #4a5668;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.screen-output {
    font-size: 38px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

/* Calculator Keypad Grid Structure */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* Button UI Components */
.btn {
    background-color: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    color: #ffffff;
    font-size: 22px;
    font-weight: 600;
    height: 68px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn:active {
    transform: scale(0.95);
    background-color: #131926;
}

/* Layout overrides for grid */
.btn-zero {
    grid-column: span 2;
}

.btn-equals {
    grid-row: span 2;
    height: auto; /* Scales down across rows automatically */
    background: linear-gradient(135deg, #a478ff 0%, #635bff 100%);
    box-shadow: 0 4px 15px rgba(99, 91, 255, 0.3);
    border: none;
    font-size: 26px;
}

.btn-equals:active {
    background: linear-gradient(135deg, #8b5cf6 0%, #4f46e5 100%);
}

/* Color codes directly from your platform accents */
.btn-action {
    color: #f5a623; /* Parallel market gold accent */
    font-size: 18px;
}

.btn-operator {
    color: #2ecc71; /* Official market green accent */
}

/* Footer note formatting */
.engine-footer {
    text-align: center;
    font-size: 11px;
    color: #4a5668;
    margin-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
}
