/* 
  3mlati - Premium Currency Converter
  School Project Delivery Version
  Refined Design System v3.0
*/

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Premium Gold & Deep Onyx */
    --bg-dark: #050505;
    --surface-depth: #0a0a0a;
    --surface-card: #111111;
    --surface-glass: rgba(15, 15, 15, 0.75);
    
    --gold-primary: #d4af37;
    --gold-bright: #f4d03f;
    --gold-deep: #b8860b;
    --gold-soft: rgba(212, 175, 55, 0.12);
    --gold-gradient: linear-gradient(135deg, #9a7b00 0%, #d4af37 50%, #f4d03f 100%);
    --gold-glow: 0 0 20px rgba(212, 175, 55, 0.2);
    
    --text-pure: #ffffff;
    --text-muted: #b0b0b0;
    --text-dim: #707070;
    
    --accent-green: #34d399;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    
    --border-light: rgba(255, 255, 255, 0.05);
    --border-gold: rgba(212, 175, 55, 0.2);
    
    /* Shadows & Effects */
    --shadow-main: 0 20px 50px rgba(0, 0, 0, 0.7);
    --shadow-inner: inset 0 1px 1px rgba(255, 255, 255, 0.05);
    
    /* Typography */
    --font-en: 'Outfit', sans-serif;
    --font-ar: 'Cairo', sans-serif;
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Layout Constants */
    --nav-height: 70px;

    /* Responsive font scale */
    --fs-logo: 2rem;
    --fs-amount: 1.75rem;
    --fs-rate: 1rem;
    --fs-body: 0.85rem;
    --fs-small: 0.75rem;
    --fs-tiny: 0.7rem;

    /* Spacing */
    --sp-xs: 0.25rem;
    --sp-sm: 0.5rem;
    --sp-md: 1rem;
    --sp-lg: 1.5rem;
    --sp-xl: 2rem;
}

/* Global Premium Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--gold-soft), var(--gold-primary), var(--gold-soft));
    border-radius: 10px;
    border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-bright);
}

/* ============================================
   Base Reset
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-pure);
    font-family: var(--font-en);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 1rem;
    overflow-x: hidden;
    position: relative;
}

/* ============================================
   Enhanced Animated Background
   ============================================ */
.animated-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #0a0a0a 0%, #000 100%);
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--gold-soft) 0%, transparent 70%);
    filter: blur(80px);
    opacity: 0.4;
    border-radius: 50%;
}

.blob-1 { top: -10%; left: -10%; animation: move 20s infinite alternate; }
.blob-2 { bottom: -10%; right: -10%; animation: move 25s infinite alternate-reverse; }

@keyframes move {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 50px) scale(1.2); }
}

.particle {
    z-index: 0;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

body::before, body::after { display: none; } /* Disable old background blobs */

[dir="rtl"] body {
    font-family: var(--font-ar);
}

/* ============================================
   Layout
   ============================================ */
.container {
    width: 100%;
    max-width: 480px;
    padding: 1.5rem 1.25rem calc(var(--nav-height) + 2rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 10;
    min-height: 100vh;
}

/* ============================================
   Header Components
   ============================================ */
.top-actions {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 100;
    display: flex;
    gap: 0.5rem;
}

.offline-banner {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--accent-red);
    color: white;
    padding: 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    animation: slideInDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.offline-banner.active {
    display: flex;
}

@keyframes slideInDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

[dir="rtl"] .top-actions {
    right: auto;
    left: 1.25rem;
}

#share-btn, #lang-btn {
    background: var(--gold-soft);
    border: 1px solid var(--border-gold);
    color: var(--gold-primary);
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    font-family: var(--font-ar);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#share-btn {
    padding: 0.5rem;
    font-size: 1.2rem;
    border-radius: 50%;
    width: 38px;
    height: 38px;
}

#share-btn:hover, #lang-btn:hover {
    background: rgba(212, 175, 55, 0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding-top: 2.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--gold-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--bg-dark);
    box-shadow: var(--shadow-glow);
}

.logo {
    font-family: var(--font-ar);
    font-weight: 800;
    font-size: var(--fs-logo);
    background: linear-gradient(to right, #b8960b, #d4af37, #ffdf70, #d4af37, #b8960b);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    animation: shine 4s linear infinite;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.3));
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.logo span {
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--gold-bright);
    -webkit-text-fill-color: var(--gold-bright);
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

/* ============================================
   Main Converter Card
   ============================================ */
.converter-card {
    background: rgba(20, 20, 20, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-light);
    border-radius: 28px;
    padding: 1.75rem;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.5), 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 40px rgba(212, 175, 55, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s var(--transition-smooth), box-shadow 0.4s var(--transition-smooth);
}

.converter-card:hover {
    box-shadow: 
        0 40px 80px rgba(0, 0, 0, 0.6), 
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 60px rgba(212, 175, 55, 0.1);
}

.converter-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gold-gradient);
}

/* Input Fields */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.section-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-inline-start: 0.25rem;
}

.glass-input {
    background: rgba(15, 15, 15, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    transition: var(--transition-fast);
}

[dir="rtl"] .glass-input {
    flex-direction: row-reverse;
}

.glass-input:focus-within {
    border-color: var(--gold-primary);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2), inset 0 0 10px rgba(212, 175, 55, 0.05);
    transform: translateY(-2px);
}

/* Currency Selection Area */
.currency-selector {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    padding-inline-end: 1rem;
    border-inline-end: 1px solid var(--border-light);
    user-select: none;
    transition: var(--transition-fast);
}

.currency-selector:hover {
    opacity: 0.85;
}

.flag-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: contain;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1px;
}

.currency-select {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}

.select-arrow {
    color: var(--gold-primary);
    font-size: 0.9rem;
}

/* Amount Typing Area */
.amount-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--gold-bright);
    font-size: var(--fs-amount);
    font-weight: 700;
    text-align: end;
    font-family: var(--font-en);
    width: 100%;
    direction: ltr;
}

[dir="rtl"] .amount-input {
    text-align: end;
}

.amount-input::placeholder {
    color: var(--text-dim);
}

.amount-input[readonly] {
    color: var(--gold-primary);
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    margin-inline-start: 0.5rem;
    transition: var(--transition-fast);
}

.copy-btn:hover {
    color: var(--gold-primary);
    transform: scale(1.1);
}

.copy-btn.copied {
    color: var(--accent-green);
    animation: bounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.currency-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: end;
    padding-inline-end: 0.5rem;
}

/* Quick Amounts */
.quick-amounts {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.quick-amount-btn {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold-bright);
    border-radius: 12px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-amount-btn:hover {
    background: var(--gold-primary);
    color: var(--bg-dark);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.quick-amount-btn.clear-btn {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--accent-red);
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
}

.quick-amount-btn.clear-btn:hover {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 4px 10px rgba(248, 113, 113, 0.2);
}

/* ============================================
   Action & Divider
   ============================================ */
.swap-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.25rem 0;
}

.swap-container .line {
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.swap-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 15, 15, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid var(--gold-primary);
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.swap-btn:hover {
    background: var(--gold-primary);
    color: var(--bg-dark);
    transform: rotate(180deg) scale(1.1);
}

/* ============================================
   Details Grid
   ============================================ */
.glass-details {
    background: rgba(15, 15, 15, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid var(--border-light);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.detail-row.last {
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.detail-label {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.detail-value {
    font-weight: 600;
}

.detail-value.highlight {
    color: var(--gold-primary);
    font-size: 0.95rem;
    font-weight: 700;
}

.detail-value.green {
    color: var(--accent-green);
}

/* Live Dot Animation */
.live-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 2s infinite;
    opacity: 0;
    transition: 0.5s;
}

.live-dot.visible {
    opacity: 1;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.rate-updated {
    animation: rate-flash-glow 0.6s ease-out;
}

/* ============================================
   Footer & Credit
   ============================================ */
footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

#secure-text {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.dev-credit {
    background: rgba(212, 175, 55, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 20px;
    padding: 1.25rem;
    position: relative;
}

.dev-credit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--gold-gradient);
    border-radius: 0 0 10px 10px;
}

.dev-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.dev-names {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
}

.dev-names span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold-bright);
}

.dev-names span:nth-child(odd) { text-align: left; }
.dev-names span:nth-child(even) { text-align: right; }

.school-info {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* ============================================
   Currency Picker Overlay
   ============================================ */
.picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.picker-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.currency-picker {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 480px;
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: 30px 30px 0 0;
    z-index: 1001;
    height: 85vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
}

.currency-picker.active {
    transform: translateX(-50%) translateY(0);
}

.picker-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.picker-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.picker-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--gold-soft);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--border-gold);
}

.picker-close {
    width: 32px;
    height: 32px;
    background: var(--surface-depth);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.picker-search-wrap {
    padding: 0 1.5rem 1rem;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 2.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

[dir="rtl"] .search-icon {
    left: auto;
    right: 2.25rem;
}

.picker-search {
    width: 100%;
    background: var(--surface-depth);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    color: var(--text-pure);
    font-family: inherit;
    outline: none;
}

[dir="rtl"] .picker-search {
    padding: 0.8rem 2.5rem 0.8rem 1rem;
}

.picker-search:focus {
    border-color: var(--gold-primary);
}

/* List Items */
.picker-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem 2rem;
}

.picker-section-label {
    font-size: 0.72rem;
    color: var(--gold-primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 1.5rem 0.5rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.picker-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border-gold), transparent);
}


.popular-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
}

.popular-chip {
    background: var(--surface-depth);
    border: 1px solid var(--border-light);
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.popular-chip img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: contain;
}

.popular-chip:hover, .popular-chip.selected {
    border-color: var(--gold-primary);
    background: var(--gold-soft);
    color: var(--gold-bright);
}

.chip-remove {
    background: transparent;
    border: none;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-inline-start: 0.25rem;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chip-remove:hover {
    color: var(--accent-red);
    transform: scale(1.1);
}

.picker-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    margin-bottom: 0.25rem;
}

.picker-item:hover {
    background: var(--gold-soft);
    border-color: var(--border-gold);
    transform: translateX(5px);
}

[dir="rtl"] .picker-item:hover {
    transform: translateX(-5px);
}

.picker-item.selected {
    background: var(--gold-primary);
    color: var(--bg-dark);
}

.picker-item.selected .currency-code {
    color: var(--bg-dark);
}

.picker-item.selected .currency-name {
    color: rgba(0, 0, 0, 0.6);
}

.picker-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: contain;
    background: #111;
    padding: 2px;
}

.picker-item-info {
    flex: 1;
}

.picker-item-code {
    font-weight: 800;
    font-size: 1rem;
}

.picker-item-name {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.picker-item-check {
    color: var(--gold-primary);
    font-size: 1.2rem;
    opacity: 0;
}

.picker-item.selected .picker-item-check {
    opacity: 1;
}

.picker-item-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fav-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    padding: 4px;
    border-radius: 50%;
}

.fav-btn:hover {
    color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.15);
    transform: scale(1.1);
}


.fav-btn.active {
    color: var(--gold-primary);
}

/* Popular Icons Grid in Picker */
.popular-icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 0.5rem;
    padding: 0.6rem;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.popular-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid var(--border-gold);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
    overflow: hidden;
}

.popular-icon-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.popular-icon-btn img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.picker-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.5rem 0.5rem 0;
}

[dir="rtl"] .strength-value {
    align-items: flex-start;
}

[dir="rtl"] .strength-chg {
    margin-left: 0;
    margin-right: 0.15rem;
}

/* ============================================
   Animations & Polish
   ============================================ */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (min-width: 600px) {
    .currency-picker {
        height: auto;
        max-height: 70vh;
        bottom: auto;
        top: 50%;
        transform: translate(-50%, -45%) scale(0.95);
        border-radius: 28px;
        opacity: 0;
        pointer-events: none;
    }
    .currency-picker.active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        pointer-events: all;
    }

    .container { max-width: 560px; padding: 2rem 2rem calc(var(--nav-height) + 2rem); }
    .converter-card { padding: 2rem; }
    .pairs-grid { grid-template-columns: repeat(4, 1fr); }
    .chart-container { height: 260px; }
    .nav-bar { max-width: 480px; }
}

@media (min-width: 900px) {
    .container { max-width: 640px; }
    body { padding-top: 2.5rem; }
    .pairs-grid { grid-template-columns: repeat(4, 1fr); }
    .chart-container { height: 300px; }
}

@media (max-width: 400px) {
    :root {
        --fs-logo: 1.75rem;
        --fs-amount: 1.5rem;
        --fs-rate: 0.9rem;
    }
    .container { padding: 1rem; gap: 1.25rem; }
    .converter-card { padding: 1.25rem; border-radius: 22px; }
    .pair-item { padding: 0.6rem; }
    .pair-inverse { font-size: 0.5rem; }
    .strength-label { font-size: 0.7rem; min-width: 55px; }
    .strength-bar { height: 10px; }
    .quick-amount-btn { padding: 0.25rem 0.5rem; font-size: 0.7rem; }
}

@media (max-width: 359px) {
    :root {
        --fs-logo: 1.4rem;
        --fs-amount: 1.25rem;
        --fs-rate: 0.8rem;
    }
    .container { padding: 0.6rem; gap: 1rem; }
    .converter-card { padding: 0.85rem; border-radius: 18px; gap: 1rem; }
    .pairs-grid { grid-template-columns: 1fr 1fr; gap: 0.35rem; }
    .pair-item { padding: 0.5rem; gap: 0.25rem; }
    .pair-flags { gap: 0.1rem; }
    .pair-flag { width: 18px; height: 18px; }
    .pair-name { font-size: 0.6rem; }
    .pair-rate { font-size: var(--fs-rate); }
    .pair-change { font-size: 0.55rem; padding: 0.05rem 0.3rem; }
    .strength-label { min-width: 45px; font-size: 0.65rem; gap: 0.25rem; }
    .strength-flag { width: 15px; height: 15px; }
    .strength-bar { height: 8px; }
    .strength-value { min-width: 42px; }
    .strength-pct { font-size: 0.65rem; }
    .strength-tier { font-size: 0.45rem; }
    .nav-item { padding: 0.3rem; }
    .nav-item ion-icon { font-size: 1.2rem; }
    .nav-item span { font-size: 0.6rem; }
    .glass-details { padding: 0.85rem; gap: 0.5rem; }
    .section-label { font-size: 0.65rem; }
    .currency-select { font-size: 0.9rem; }
    .flag-icon { width: 24px; height: 24px; }
    .quick-amount-btn { padding: 0.2rem 0.4rem; font-size: 0.65rem; }
    .swap-btn { width: 40px; height: 40px; font-size: 1.1rem; }
    .chart-container { height: 160px; }
    .chart-card { padding: 1rem; }
    .trends-pair-selector { padding: 0.5rem; gap: 0.5rem; }
    .trend-sel { padding: 0.3rem 0.5rem; }
    .trend-sel span { font-size: 0.8rem; }
}

/* ============================================
   New Features (Quick Amounts & Copy)
   ============================================ */
.quick-amounts-wrapper {
    margin-top: 0.25rem;
}

.quick-amounts {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

[dir="rtl"] .quick-amounts {
    justify-content: flex-start;
}

/* ============================================
   Favorites & Popular Currencies
   ============================================ */
.currencies-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.currencies-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.currencies-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 0.5rem;
}

.currencies-icons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

.currency-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem;
    border-radius: 14px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid var(--border-gold);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    min-width: 50px;
    position: relative;
    overflow: hidden;
}

.currency-icon-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.currency-icon-btn img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: block;
}

.currency-icon-code {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-pure);
}

.currency-icon-fav {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 1rem;
    color: #fbbf24;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.currency-icon-btn.fav-added .currency-icon-fav {
    opacity: 1;
}

@media (max-width: 359px) {
    .currency-icon-btn {
        min-width: 45px;
        padding: 0.4rem;
    }
    .currency-icon-btn img {
        width: 20px;
        height: 20px;
    }
    .currency-icon-code {
        font-size: 0.6rem;
    }
    .currencies-label {
        font-size: 0.75rem;
    }
}

/* ============================================
   Ripple Effect
   ============================================ */
.ripple-btn {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-anim 0.6s linear;
    background-color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

/* ============================================
   Navigation Bar
   ============================================ */
.nav-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2.5rem);
    max-width: 400px;
    height: 68px;
    background: rgba(15, 15, 15, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.75rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-fast);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
}

.nav-item ion-icon {
    font-size: 1.4rem;
}

.nav-item.active {
    color: var(--gold-primary);
}

.nav-item.active ion-icon {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: var(--gold-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gold-primary);
}

/* ============================================
   Tab System
   ============================================ */
.tab-content {
    display: none;
    animation: fadeIn 0.4s var(--transition-smooth);
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Chart Section
   ============================================ */
.chart-card {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-main);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gold-primary);
}

.chart-trend {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
}

.trend-up { background: rgba(52, 211, 153, 0.1); color: var(--accent-green); }
.trend-down { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }

.chart-container {
    width: 100%;
    height: 200px;
    position: relative;
}


/* ============================================
   Skeleton Loaders
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   About Section
   ============================================ */
.about-card {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-logo {
    font-size: 3rem;
    color: var(--gold-primary);
}

.about-names {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.about-name {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.about-name span {
    font-weight: 700;
    color: var(--gold-bright);
}

.about-name small {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ============================================
   Converter Inset Sections (Popular Pairs & Strength)
   ============================================ */
.converter-inset {
    gap: 0.75rem;
}

.pairs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.pair-item {
    background: var(--surface-depth);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.pair-item:hover {
    border-color: var(--border-gold);
    transform: translateY(-4px);
    background: var(--gold-soft);
}

.pair-flags {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.pair-flag {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: contain;
    border: 1px solid rgba(255,255,255,0.1);
}

.pair-slash {
    color: var(--text-dim);
    font-size: 0.7rem;
    opacity: 0.5;
}

.pair-name {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 700;
}

.pair-rate {
    font-size: var(--fs-rate);
    font-weight: 800;
    color: var(--gold-bright);
}

.pair-change {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    margin-top: 0.2rem;
}

.pair-change.up { color: var(--accent-green); background: rgba(34, 197, 94, 0.1); }
.pair-change.down { color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }

/* Inverse rate */
.pair-inverse {
    font-size: 0.55rem;
    color: var(--text-dim);
    opacity: 0.45;
    font-weight: 500;
    line-height: 1;
}

/* Rate flash animation */
@keyframes flash-up {
    0% { color: var(--accent-green); }
    100% { color: var(--gold-bright); }
}
@keyframes flash-down {
    0% { color: var(--accent-red); }
    100% { color: var(--gold-bright); }
}
.pair-rate.flash-up { animation: flash-up 0.8s ease-out; }
.pair-rate.flash-down { animation: flash-down 0.8s ease-out; }

/* Category tint */
.pair-item.cat-me {
    background: rgba(212, 175, 55, 0.04);
}
.pair-item.cat-major {
    background: rgba(59, 130, 246, 0.04);
}
.pair-item.cat-me:hover {
    background: var(--gold-soft);
}
.pair-item.cat-major:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Clickable strength row */
.strength-row.clickable {
    cursor: pointer;
    border-radius: 8px;
    padding: 0.2rem 0.3rem;
    margin: 0 -0.3rem;
    transition: background 0.2s;
}
.strength-row.clickable:hover {
    background: rgba(212, 175, 55, 0.06);
}

/* Exchange rate flash */
@keyframes rate-flash-glow {
    0% { color: var(--accent-green); text-shadow: 0 0 8px rgba(52, 211, 153, 0.4); }
    100% { color: var(--gold-primary); text-shadow: none; }
}
.rate-flash {
    animation: rate-flash-glow 0.6s ease-out;
}

/* Strength Bars Container & Rows */
.strength-bars {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.5rem;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.strength-bars::-webkit-scrollbar {
    width: 6px;
}

.strength-bars::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.08);
    border-radius: 10px;
}

.strength-bars::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 10px;
}

.strength-bars::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

.strength-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.15rem 0;
}

.strength-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 62px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.strength-flag {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.strength-bar {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s var(--transition-smooth);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.strength-value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.05rem;
    min-width: 55px;
}

.strength-pct {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.strength-chg {
    font-size: 0.6rem;
    font-weight: 700;
    margin-left: 0.15rem;
}

.strength-chg.up { color: var(--accent-green); }
.strength-chg.down { color: var(--accent-red); }

.strength-tier {
    font-size: 0.52rem;
    color: var(--text-dim);
    opacity: 0.65;
    font-weight: 500;
    white-space: nowrap;
}

/* Show More Button */
.show-more-btn {
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.15);
    color: var(--gold-primary);
    width: 100%;
    padding: 0.45rem;
    border-radius: 12px;
    margin-top: 0.25rem;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.show-more-btn:hover {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.3);
}

.converter-inset {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px dashed rgba(212, 175, 55, 0.2) !important;
    margin-top: -0.5rem;
}

.update-timestamp {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.update-timestamp .detail-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    gap: 0.3rem;
}

.update-timestamp .detail-label ion-icon {
    font-size: 0.8rem;
}

/* Refresh button */
.refresh-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    border-radius: 50%;
    width: 28px;
    height: 28px;
}

.refresh-btn:hover {
    color: var(--gold-primary);
    background: var(--gold-soft);
}

.refresh-btn.spinning ion-icon {
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


/* ============================================
   Trends Pair Selector
   ============================================ */
.trends-pair-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--surface-card);
    padding: 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-inner);
    margin-bottom: 0.5rem;
}

.trend-sel {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.trend-sel:hover {
    background: var(--gold-soft);
    border-color: var(--border-gold);
}

.trend-sel span {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gold-bright);
}

.trends-pair-selector ion-icon {
    color: var(--text-dim);
    font-size: 1.2rem;
}

[dir="rtl"] .trends-pair-selector ion-icon {
    transform: rotate(180deg);
}

/* ============================================
   Chart Range Selector
   ============================================ */
.chart-range-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.range-btn {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.range-btn:hover {
    border-color: var(--gold-soft);
    color: var(--gold-bright);
}

.range-btn.active {
    background: var(--gold-primary);
    color: var(--bg-dark);
    border-color: var(--gold-bright);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* ============================================
   Smart Widget (PWA Widget Style)
   ============================================ */
.smart-widget {
    background: rgba(15, 15, 15, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: 22px;
    padding: 1rem;
    box-shadow: var(--shadow-inner);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
}

.widget-pairs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.widget-pair {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: var(--transition-fast);
}

.widget-pair:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--border-gold);
}

.w-pair-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.w-pair-info img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.w-pair-codes {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-pure);
}

.w-pair-val {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--gold-bright);
}

.w-pair-chg {
    font-size: 0.65rem;
    font-weight: 700;
    padding-inline-start: 0.4rem;
}

