/*
 * RetroVault — CSS Styles
 * Inspired by 80s-90s Hi-Fi Equipment
 * Marantz, Technics, Pioneer, Sansui, Yamaha
 */

/* ========== CSS VARIABLES (THEMES) ========== */

:root {
    /* Classic Theme (default) */
    --bg: #0a0e14;
    --panel: #0f1520;
    --panel2: #0c1218;
    --border: #1e2a3a;
    --text: #e8f0ff;
    --text-dim: #8a9db5;
    --accent: #4bd4ff;
    --accent-glow: rgba(75, 212, 255, 0.4);
    --danger: #ff5566;
    --success: #4dff88;
    --warning: #ffcc44;
    
    /* Layout */
    --radius: 12px;
    --radius-lg: 18px;
    --gap: 12px;
}

/* Theme: Technics */
.theme-technics {
    --bg: #080c08;
    --panel: #0c140c;
    --panel2: #0a120a;
    --border: #1a2a1a;
    --accent: #00ff88;
    --accent-glow: rgba(0, 255, 136, 0.35);
}

/* Theme: Pioneer */
.theme-pioneer {
    --bg: #0c0a08;
    --panel: #14100c;
    --panel2: #120e0a;
    --border: #2a2218;
    --accent: #ffaa00;
    --accent-glow: rgba(255, 170, 0, 0.35);
}

/* Theme: Sansui */
.theme-sansui {
    --bg: #080a06;
    --panel: #10140c;
    --panel2: #0e120a;
    --border: #222a18;
    --accent: #a7ff4d;
    --accent-glow: rgba(167, 255, 77, 0.4);
}

/* Secret Theme: Sanyo Elite */
.theme-sanyo_elite {
    --bg: #0c080a;
    --panel: #140c10;
    --panel2: #120a0e;
    --border: #2a1820;
    --accent: #ff6b9d;
    --accent-glow: rgba(255, 107, 157, 0.4);
}

/* Secret Theme: Yamaha Legend */
.theme-yamaha_legend {
    --bg: #0a080c;
    --panel: #100c14;
    --panel2: #0e0a12;
    --border: #201828;
    --accent: #9d6bff;
    --accent-glow: rgba(157, 107, 255, 0.4);
}

/* Secret Theme: Sansui Master */
.theme-sansui_master {
    --bg: #060a0a;
    --panel: #0c1414;
    --panel2: #0a1212;
    --border: #182828;
    --accent: #6bffd4;
    --accent-glow: rgba(107, 255, 212, 0.4);
}

/* ========== RESET & BASE ========== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== MAIN APP ========== */

#app {
    max-width: 480px;
    margin: 0 auto;
    padding: 12px;
    min-height: 100vh;
}

/* ========== HEADER ========== */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    font-size: 32px;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.brand-text h1 {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 3px;
    line-height: 1.2;
}

.brand-text .accent {
    color: var(--accent);
}

.brand-sub {
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 2px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    background: var(--panel2);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* ========== DISPLAY PANEL (Main Wallet) ========== */

.display-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}

.display-label {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.display-screen {
    background: linear-gradient(180deg, #050810 0%, #0a1018 100%);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    
    /* VFD screen effect */
    box-shadow: 
        inset 0 0 30px rgba(0,0,0,0.8),
        0 0 20px var(--accent-glow);
}

.wallet-info {
    margin-bottom: 12px;
}

.wallet-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.wallet-address {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.balance-display {
    text-align: center;
    padding: 12px 0;
}

.balance-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
}

.balance-value {
    font-size: 42px;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 30px var(--accent-glow);
    letter-spacing: 2px;
    font-family: 'VT323', monospace;
}

.balance-unit {
    font-size: 16px;
    color: var(--text);
    font-weight: 700;
}

.balance-usd {
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* VU Meter */
.vu-meter {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.vu-bar {
    width: 8px;
    height: 24px;
    background: var(--panel2);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.vu-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--level, 0%);
    background: linear-gradient(to top, var(--accent), var(--success));
    transition: height 0.3s;
}

/* Action Buttons */
.action-row {
    display: flex;
    gap: var(--gap);
}

.action-btn {
    flex: 1;
    height: 50px;
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.action-btn .btn-icon {
    font-size: 18px;
}

.action-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.action-btn.accent {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel2) 100%);
    border-color: var(--accent);
}

/* ========== WALLET LIST ========== */

.wallets-section {
    margin-top: 8px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

.section-count {
    color: var(--text-dim);
    font-size: 12px;
}

.wallet-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wallet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.wallet-row:hover {
    border-color: var(--accent);
}

.wallet-row.active {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.wallet-row-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.active-dot {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.wallet-row-address {
    font-family: 'VT323', monospace;
    font-size: 12px;
    color: var(--text-dim);
}

.wallet-row-tag {
    padding: 6px 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ========== MODALS ========== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.modal.open {
    display: flex;
}

.modal-card {
    width: 100%;
    max-width: 400px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--panel2);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

.modal-header.accent {
    border-bottom-color: var(--accent);
}

.modal-header.danger {
    background: linear-gradient(90deg, #2a1418, var(--panel2));
    border-bottom-color: var(--danger);
    color: var(--danger);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 16px;
}

.modal-body.center {
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 10px;
    padding: 0 16px 16px;
}

/* ========== FORM ELEMENTS ========== */

.input-group {
    margin-bottom: 14px;
}

.input-group label {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.input-group input,
.input-group select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'VT323', monospace;
    font-size: 16px;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.input-with-unit {
    display: flex;
    gap: 8px;
}

.input-with-unit input {
    flex: 1;
}

.input-with-unit select {
    width: 90px;
}

/* Buttons */
.btn {
    flex: 1;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn.primary {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel2) 100%);
    border-color: var(--accent);
    color: var(--text);
}

.btn.primary:hover {
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn.ghost {
    background: var(--panel2);
    color: var(--text-dim);
}

.btn.ghost:hover {
    border-color: var(--text-dim);
    color: var(--text);
}

.btn.small {
    height: 36px;
    flex: none;
    padding: 0 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Warning Box */
.warning-box {
    padding: 12px;
    background: rgba(255, 204, 68, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--warning);
    line-height: 1.5;
}

/* ========== SEED PHRASE DISPLAY ========== */

.seed-modal {
    max-width: 440px;
}

.seed-warning {
    padding: 12px;
    background: rgba(255, 85, 102, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--danger);
    text-align: center;
    margin-bottom: 16px;
}

.seed-display {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 16px;
    background: var(--panel2);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.seed-word {
    padding: 8px;
    background: var(--panel);
    border-radius: 6px;
    font-family: 'VT323', monospace;
    font-size: 14px;
    text-align: center;
}

.seed-word span {
    color: var(--accent);
    margin-right: 4px;
}

.seed-confirm {
    padding: 12px;
    background: var(--panel2);
    border-radius: var(--radius);
}

.seed-confirm label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--text-dim);
    cursor: pointer;
}

.seed-confirm input {
    margin-top: 2px;
}

/* ========== SWAP SPECIFIC ========== */

.swap-info {
    padding: 10px;
    background: rgba(75, 212, 255, 0.1);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    font-size: 12px;
    text-align: center;
    margin-bottom: 16px;
}

.swap-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.swap-arrow {
    align-self: center;
    width: 40px;
    height: 32px;
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--accent);
    font-size: 18px;
    cursor: pointer;
}

.swap-quote {
    padding: 12px;
    background: var(--panel2);
    border-radius: var(--radius);
    font-size: 12px;
    margin-bottom: 14px;
    min-height: 60px;
}

.swap-settings {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--panel2);
    border-radius: var(--radius);
    font-size: 12px;
    margin-bottom: 14px;
}

.slippage input {
    width: 50px;
    height: 28px;
    padding: 0 6px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 12px;
    text-align: center;
}

/* ========== SETTINGS ========== */

.settings-section {
    margin-bottom: 20px;
}

.settings-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.theme-btn {
    padding: 12px;
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-btn:hover {
    border-color: var(--accent);
}

.theme-btn.active {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.secret-unlock {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.secret-unlock input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
}

.secret-themes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.settings-info {
    font-size: 12px;
    color: var(--text-dim);
}

/* ========== QR CODE ========== */

.qr-placeholder {
    width: 180px;
    height: 180px;
    margin: 0 auto 16px;
    background: white;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-mock {
    font-size: 48px;
    color: #ccc;
}

.address-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: var(--panel2);
    border-radius: var(--radius);
    font-family: 'VT323', monospace;
    font-size: 14px;
    word-break: break-all;
}

.copy-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

/* ========== TOAST NOTIFICATIONS ========== */

.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    animation: toastIn 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

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

/* ========== SCROLLBAR ========== */

::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}
