/* ==========================================================================
   SUGARCODE CURRENCY CONVERTER UI STYLES
   Cyberpunk / Dark Glassmorphism Styling for Currency Selector & Modal Tray
   ========================================================================== */

.currency-converter-widget {
    display: inline-flex;
    align-items: center;
    position: relative;
    font-family: 'Space Mono', monospace;
    z-index: 95;
}

/* Nav Bar Button in Header */
.nav-currency-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(18, 22, 30, 0.7);
    border: 1px solid rgba(102, 252, 241, 0.35);
    border-radius: 50px;
    padding: 0.35rem 0.85rem;
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    pointer-events: auto !important; /* Critical so clicks register inside .nav-links-center */
    user-select: none;
    text-decoration: none;
    color: #fff;
}

.nav-currency-wrap:hover {
    border-color: var(--accent-primary, #66fcf1);
    box-shadow: 0 0 15px rgba(102, 252, 241, 0.35);
    background: rgba(22, 28, 38, 0.95);
    transform: translateY(-1px);
}

.currency-icon {
    color: var(--accent-primary, #66fcf1);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

.currency-display-code {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #fff;
}

.currency-display-flag {
    font-size: 0.85rem;
    line-height: 1;
}

.currency-caret {
    color: var(--accent-primary, #66fcf1);
    font-size: 0.65rem;
    margin-left: 2px;
    transition: transform 0.25s ease;
}

.nav-currency-wrap:hover .currency-caret,
.floating-currency-pill:hover .currency-caret {
    transform: translateY(2px);
}

/* Floating Currency Switcher for Mobile / Global Access */
.floating-currency-pill {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 105;
    background: rgba(11, 12, 16, 0.9);
    border: 1px solid rgba(102, 252, 241, 0.4);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(102, 252, 241, 0.25);
    border-radius: 50px;
    padding: 0.5rem 0.95rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    user-select: none;
    pointer-events: auto !important;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-currency-pill:hover {
    border-color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85), 0 0 25px rgba(102, 252, 241, 0.45);
}

.floating-currency-pill .currency-display-code {
    font-size: 0.8rem;
}

/* ==========================================================================
   CYBERPUNK CURRENCY TRAY (MODAL DRAWER)
   ========================================================================== */

.currency-tray-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(11, 12, 16, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.currency-tray-backdrop.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.currency-tray-panel {
    background: linear-gradient(145deg, rgba(31, 40, 51, 0.96), rgba(11, 12, 16, 0.98));
    border: 1px solid rgba(102, 252, 241, 0.35);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(102, 252, 241, 0.25);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    max-height: 85dvh;
    display: flex;
    flex-direction: column;
    padding: 1.8rem 2rem;
    box-sizing: border-box;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Space Mono', monospace;
}

.currency-tray-backdrop.active .currency-tray-panel {
    transform: translateY(0) scale(1);
}

.currency-tray-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.2rem;
}

.tray-title-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.tray-icon {
    width: 44px;
    height: 44px;
    background: rgba(102, 252, 241, 0.1);
    border: 1px solid rgba(102, 252, 241, 0.35);
    color: var(--accent-primary, #66fcf1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(102, 252, 241, 0.2);
}

.currency-tray-title {
    color: #fff;
    font-size: 1.25rem;
    margin: 0 0 0.2rem;
    font-weight: 700;
    font-family: 'Outfit', -apple-system, sans-serif;
}

.currency-tray-subtitle {
    color: #8c9096;
    font-size: 0.78rem;
    margin: 0;
    font-family: -apple-system, sans-serif;
}

.currency-tray-close {
    background: transparent;
    border: none;
    color: #8c9096;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    padding: 0.2rem 0.5rem;
}

.currency-tray-close:hover {
    color: var(--accent-primary, #66fcf1);
    transform: rotate(90deg);
}

/* Search Box in Tray */
.currency-tray-search-wrap {
    position: relative;
    margin-bottom: 1.2rem;
}

.tray-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8c9096;
    font-size: 0.85rem;
    pointer-events: none;
}

.currency-tray-search {
    width: 100%;
    background: rgba(11, 12, 16, 0.8);
    border: 1px solid rgba(102, 252, 241, 0.25);
    border-radius: 8px;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s;
}

.currency-tray-search:focus {
    border-color: var(--accent-primary, #66fcf1);
    box-shadow: 0 0 12px rgba(102, 252, 241, 0.25);
    background: rgba(11, 12, 16, 0.95);
}

/* Currency Grid */
.currency-tray-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    overflow-y: auto;
    padding-right: 0.4rem;
    margin-bottom: 1.2rem;
    max-height: 48vh;
    max-height: 48dvh;
}

/* Scrollbar Styling */
.currency-tray-grid::-webkit-scrollbar {
    width: 5px;
}
.currency-tray-grid::-webkit-scrollbar-track {
    background: rgba(11, 12, 16, 0.5);
    border-radius: 10px;
}
.currency-tray-grid::-webkit-scrollbar-thumb {
    background: rgba(102, 252, 241, 0.3);
    border-radius: 10px;
}
.currency-tray-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary, #66fcf1);
}

/* Currency Option Tile */
.currency-tile {
    background: rgba(18, 22, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
}

.currency-tile:hover {
    background: rgba(22, 28, 38, 0.9);
    border-color: rgba(102, 252, 241, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.currency-tile.active {
    background: rgba(102, 252, 241, 0.12);
    border-color: var(--accent-primary, #66fcf1);
    box-shadow: 0 0 15px rgba(102, 252, 241, 0.25);
}

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

.tile-flag {
    font-size: 1.35rem;
    line-height: 1;
}

.tile-info {
    display: flex;
    flex-direction: column;
}

.tile-code {
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.5px;
}

.tile-name {
    color: #8c9096;
    font-size: 0.7rem;
    font-family: -apple-system, sans-serif;
}

.tile-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tile-symbol {
    color: var(--accent-primary, #66fcf1);
    font-weight: 700;
    font-size: 0.95rem;
}

.tile-check {
    color: var(--accent-primary, #66fcf1);
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.currency-tile.active .tile-check {
    opacity: 1;
}

/* Footer in Tray */
.currency-tray-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.9rem;
    text-align: center;
}

.tray-rate-indicator {
    color: #8c9096;
    font-size: 0.72rem;
    font-family: -apple-system, sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tray-rate-indicator i {
    color: var(--accent-primary, #66fcf1);
}

/* Responsive */
@media (max-width: 900px) {
    /* Hide the top navbar currency button on mobile/tablets so hamburger menu is never pushed off screen */
    .nav-currency-wrap {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .currency-tray-panel {
        padding: 1.5rem 1.2rem;
    }
    
    .currency-tray-grid {
        grid-template-columns: 1fr;
    }

    .floating-currency-pill {
        bottom: 1rem;
        right: 1rem;
        padding: 0.45rem 0.85rem;
    }
}
