/* ═══════════════════════════════════════════════════════════════
   Gold & Silver Tracker PWA - Main Stylesheet
   استایل اصلی اپ کاربر
   ═══════════════════════════════════════════════════════════════ */

/* ─── Font Import ─── */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;700&display=swap');

/* ─── CSS Variables ─── */
:root {
    /* Colors */
    --primary: #f0b90b;
    --primary-dark: #d4a50a;
    --primary-light: #fdd835;
    
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-light: #252540;
    --bg-hover: #2d2d4a;
    
    --text: #e0e0e0;
    --text-muted: #888;
    --text-dim: #666;
    
    --success: #00c853;
    --success-dark: #00a844;
    --danger: #ff1744;
    --danger-dark: #d50000;
    --warning: #ff9800;
    --info: #2196f3;
    
    --bubble-low: #00c853;
    --bubble-normal: #ffc107;
    --bubble-high: #ff9800;
    --bubble-very-high: #ff1744;
    
    /* Sizing */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(240, 185, 11, 0.3);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    /* Z-index */
    --z-header: 100;
    --z-modal: 1000;
    --z-toast: 2000;
    --z-bottom-nav: 90;
}

/* ─── Reset ─── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

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

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

/* ─── Utility Classes ─── */
.hidden {
    display: none !important;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ═══════════════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════════════ */

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 70px; /* برای bottom-nav */
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */

.header {
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(26, 26, 46, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-md);
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    border-bottom: 1px solid var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.header-content {
    flex: 1;
    text-align: center;
}

.header h1 {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}

.user-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ─── Notification Bell ─── */
.notif-bell {
    position: relative;
    width: 42px;
    height: 42px;
    background: var(--bg-light);
    border: none;
    border-radius: 50%;
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.notif-bell:hover,
.notif-bell:active {
    background: var(--bg-hover);
    transform: scale(1.05);
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    padding: 0 5px;
    border: 2px solid var(--bg-card);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ─── Admin Button in Header ─── */
#adminPanelBtn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--primary);
    color: var(--bg-dark);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all var(--transition);
    flex-shrink: 0;
}

#adminPanelBtn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION TABS
   ═══════════════════════════════════════════════════════════════ */

.nav-tabs {
    display: flex;
    background: var(--bg-card);
    padding: var(--space-sm);
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    border-bottom: 1px solid var(--bg-light);
    position: sticky;
    top: 71px;
    z-index: 99;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.75rem;
    font-family: inherit;
    white-space: nowrap;
    transition: all var(--transition);
    flex-shrink: 0;
    min-width: 70px;
}

.tab-icon {
    font-size: 1.2rem;
}

.tab-label {
    font-weight: 500;
}

.tab:hover {
    background: var(--bg-light);
    color: var(--text);
}

.tab.active {
    background: var(--primary);
    color: var(--bg-dark);
    font-weight: 700;
    box-shadow: var(--shadow-glow);
}

.tab.active .tab-icon {
    transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */

.content {
    flex: 1;
    padding: var(--space-md);
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
    animation: fadeIn var(--transition-slow);
}

.tab-content.active {
    display: block;
}

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

/* ─── Section Header ─── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.section-header h2 {
    font-size: 1.1rem;
    color: var(--text);
    font-weight: 700;
}

.btn-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--bg-light);
    border-radius: 50%;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--bg-light);
    transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════════════════════
   LOADING & STATUS
   ═══════════════════════════════════════════════════════════════ */

.loading-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--bg-light);
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.data-status {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: var(--space-md);
    font-size: 0.85rem;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-status::before {
    content: '⚠️';
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   PRICE CARDS
   ═══════════════════════════════════════════════════════════════ */

.price-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.price-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(26, 26, 46, 0.8) 100%);
    border-radius: var(--radius);
    padding: var(--space-md);
    border: 1px solid var(--bg-light);
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    animation: slideUp var(--transition-slow);
}

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

.price-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.price-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.price-card .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 4px;
}

.price-card .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    direction: ltr;
    text-align: right;
    font-variant-numeric: tabular-nums;
    margin-bottom: 4px;
}

.price-card .unit {
    font-size: 0.7rem;
    color: var(--text-dim);
    display: block;
}

.price-card .change {
    font-size: 0.75rem;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.price-card .change.up { color: var(--success); }
.price-card .change.down { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════════
   BUBBLE SECTION
   ═══════════════════════════════════════════════════════════════ */

.bubble-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--bg-light);
}

.bubble-section h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 6px;
}

.bubble-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-light);
    font-size: 0.9rem;
}

.bubble-item:last-child {
    border-bottom: none;
}

.bubble-item .coin-name {
    color: var(--text);
    font-weight: 500;
}

.bubble-item .bubble-value {
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    direction: ltr;
}

.bubble-value.very-low {
    background: rgba(0, 200, 83, 0.15);
    color: var(--bubble-low);
}

.bubble-value.low {
    background: rgba(0, 200, 83, 0.1);
    color: var(--bubble-low);
}

.bubble-value.normal {
    background: rgba(255, 193, 7, 0.15);
    color: var(--bubble-normal);
}

.bubble-value.high {
    background: rgba(255, 152, 0, 0.15);
    color: var(--bubble-high);
}

.bubble-value.very-high {
    background: rgba(255, 23, 68, 0.15);
    color: var(--bubble-very-high);
    animation: pulseHigh 2s infinite;
}

@keyframes pulseHigh {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.bubble-item .coin-detail {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    white-space: nowrap;
    user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
    box-shadow: 0 4px 12px rgba(240, 185, 11, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 20px rgba(240, 185, 11, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-lg {
    padding: 16px 24px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.btn-text:hover {
    background: rgba(240, 185, 11, 0.1);
}

.btn-text-danger {
    background: transparent;
    border: none;
    color: var(--danger);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.btn-text-danger:hover {
    background: rgba(255, 23, 68, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-light);
    border: 1px solid var(--bg-light);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.1);
}

.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"] {
    direction: ltr;
    text-align: right;
}

.form-group .hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   CALCULATOR
   ═══════════════════════════════════════════════════════════════ */

.calculator-container {
    padding: 4px;
}

.calc-mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.mode-btn {
    background: var(--bg-card);
    border: 2px solid var(--bg-light);
    border-radius: var(--radius);
    padding: var(--space-md);
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
}

.mode-btn .mode-icon {
    font-size: 1.5rem;
}

.mode-btn .mode-title {
    font-weight: 700;
    font-size: 0.9rem;
}

.mode-btn small {
    font-size: 0.7rem;
    opacity: 0.7;
    line-height: 1.4;
}

.mode-btn:hover {
    background: var(--bg-light);
    color: var(--text);
}

.mode-btn.active {
    border-color: var(--primary);
    background: rgba(240, 185, 11, 0.08);
    color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.mode-btn.active .mode-icon {
    transform: scale(1.1);
}

.calc-form {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    border: 1px solid var(--bg-light);
}

.calc-form h3 {
    color: var(--primary);
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.form-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}

.calc-results {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: var(--space-lg);
    border: 2px solid var(--primary);
    animation: fadeIn var(--transition);
    box-shadow: var(--shadow-glow);
}

.calc-results h3 {
    color: var(--primary);
    margin-bottom: var(--space-md);
    font-size: 1.05rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-light);
    font-size: 0.9rem;
    gap: var(--space-sm);
}

.result-row:last-child {
    border-bottom: none;
}

.result-row .label {
    color: var(--text-muted);
    flex: 1;
}

.result-row .value {
    font-weight: 700;
    direction: ltr;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.result-row.highlight {
    background: rgba(240, 185, 11, 0.1);
    margin: 8px -12px;
    padding: 14px 12px;
    border-radius: var(--radius-sm);
    border: none;
}

.result-row.highlight .label {
    color: var(--primary);
    font-weight: 700;
}

.result-row.highlight .value {
    color: var(--primary);
    font-size: 1.1rem;
}

.result-row.tax .value { color: var(--danger); }
.result-row.profit .value { color: var(--success); }

.result-divider {
    height: 1px;
    background: var(--bg-light);
    margin: var(--space-md) 0;
}

.result-summary {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-top: var(--space-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.9;
    border-right: 3px solid var(--primary);
}

.result-summary strong {
    color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════ */

.alerts-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.alert-stat {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    text-align: center;
    border: 1px solid var(--bg-light);
}

.alert-stat .num {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    direction: ltr;
}

.alert-stat .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.alert-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: var(--space-md);
    border: 1px solid var(--bg-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--transition);
    border-right: 4px solid var(--info);
}

.alert-item.triggered {
    border-right-color: var(--success);
    background: rgba(0, 200, 83, 0.05);
}

.alert-item.inactive {
    opacity: 0.5;
}

.alert-item:hover {
    background: var(--bg-hover);
}

.alert-info {
    flex: 1;
}

.alert-info .alert-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.alert-info .alert-condition {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.alert-info .alert-time {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.alert-actions {
    display: flex;
    gap: 6px;
}

.btn-delete-alert {
    width: 32px;
    height: 32px;
    background: rgba(255, 23, 68, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--danger);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-delete-alert:hover {
    background: var(--danger);
    color: white;
}

.add-alert-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: var(--space-lg);
    border: 1px solid var(--bg-light);
}

.add-alert-panel h3 {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: var(--space-md);
}

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATIONS LIST
   ═══════════════════════════════════════════════════════════════ */

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.user-notification {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius);
    border-right: 4px solid var(--info);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.user-notification.unread {
    background: rgba(240, 185, 11, 0.04);
}

.user-notification.read {
    opacity: 0.7;
}

.user-notification.info { border-right-color: var(--info); }
.user-notification.success { border-right-color: var(--success); }
.user-notification.warning { border-right-color: var(--warning); }
.user-notification.danger { border-right-color: var(--danger); }

.user-notification:hover {
    background: var(--bg-hover);
    transform: translateX(-2px);
}

.user-notification .notif-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.user-notification .notif-body {
    flex: 1;
    min-width: 0;
}

.user-notification .notif-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text);
    word-break: break-word;
}

.user-notification .notif-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 6px;
    word-break: break-word;
}

.user-notification .notif-time {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.notif-dot {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    align-self: center;
    flex-shrink: 0;
    animation: badgePulse 2s infinite;
}

/* ═══════════════════════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════════════════════ */

.settings-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.settings-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: var(--space-lg);
    border: 1px solid var(--bg-light);
}

.settings-card h3 {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--bg-light);
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-row span:first-child {
    color: var(--text-muted);
}

.profile-row span:last-child {
    color: var(--text);
    font-weight: 500;
    direction: ltr;
}

.settings-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════ */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: var(--space-md);
    animation: fadeIn var(--transition);
}

.modal-content {
    background: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUpModal var(--transition);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--bg-light);
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.modal-content h2,
.modal-content h3 {
    color: var(--primary);
    font-size: 1.2rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover:not(:disabled) {
    background: var(--bg-light);
    color: var(--danger);
}

.modal-close:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: var(--space-md);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-right: 4px;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-error {
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: var(--space-md);
    font-size: 0.85rem;
    color: var(--danger);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION (MOBILE)
   ═══════════════════════════════════════════════════════════════ */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--bg-light);
    padding: 6px 4px;
    z-index: var(--z-bottom-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.bottom-nav-item {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: all var(--transition);
}

.bottom-nav-item span {
    font-size: 1.3rem;
}

.bottom-nav-item.active {
    color: var(--primary);
    background: rgba(240, 185, 11, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: calc(100% - 32px);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    color: var(--text);
    padding: 12px 16px;
    border-radius: var(--radius);
    border-right: 4px solid var(--info);
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
    animation: slideDownToast var(--transition);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }
    
    .nav-tabs {
        display: none;
    }
    
    #app {
        padding-bottom: 80px;
    }
    
    .header {
        position: sticky;
        top: 0;
    }
    
    .header h1 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .price-cards {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: var(--space-sm);
    }
    
    .price-card .value {
        font-size: 1.1rem;
    }
    
    .content {
        padding: var(--space-sm);
    }
    
    .calc-mode-selector {
        grid-template-columns: 1fr;
    }
    
    .alerts-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

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

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-light) 0%,
        var(--bg-hover) 50%,
        var(--bg-light) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: var(--radius-sm);
}

/* ─── Print ─── */
@media print {
    .header,
    .nav-tabs,
    .bottom-nav,
    .btn,
    .notif-bell {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Price Card Change Indicator
   ═══════════════════════════════════════════════════════════════ */

.price-card .change {
    font-size: 0.75rem;
    margin-top: 6px;
    font-weight: 700;
    direction: ltr;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
    border-radius: 12px;
}

.price-card .change.up {
    color: var(--success);
    background: rgba(0, 200, 83, 0.1);
}

.price-card .change.down {
    color: var(--danger);
    background: rgba(255, 23, 68, 0.1);
}

.price-card .change.neutral {
    color: var(--text-dim);
    background: rgba(136, 136, 136, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   Bubble Info
   ═══════════════════════════════════════════════════════════════ */

.bubble-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-light);
    gap: var(--space-sm);
}

.bubble-item:last-child {
    border-bottom: none;
}

.bubble-info {
    flex: 1;
    min-width: 0;
}

.bubble-info .coin-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.bubble-info .coin-detail {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.bubble-right {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.bubble-status {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   Category Tabs (تب قیمت‌ها)
   ═══════════════════════════════════════════════════════════════ */

.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--bg-light);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    flex-shrink: 0;
}

.category-tab:hover {
    background: var(--bg-light);
    color: var(--text);
}

.category-tab.active {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.category-tab .cat-count {
    background: rgba(0, 0, 0, 0.15);
    color: inherit;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.category-tab.active .cat-count {
    background: rgba(15, 15, 26, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   Category Panels
   ═══════════════════════════════════════════════════════════════ */

.category-panel {
    display: none;
    animation: fadeIn var(--transition);
}

.category-panel.active {
    display: block;
}

.empty-category {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════
   Price Item (لیست قیمت‌ها)
   ═══════════════════════════════════════════════════════════════ */

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 8px;
    border: 1px solid var(--bg-light);
    gap: var(--space-md);
    transition: all var(--transition);
}

.price-item:hover {
    background: var(--bg-hover);
    transform: translateX(-2px);
    border-color: rgba(240, 185, 11, 0.3);
}

.price-item.crypto {
    border-right: 3px solid #f7931a;
}

.price-item-info {
    flex: 1;
    min-width: 0;
}

.price-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.price-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-dim);
    flex-wrap: wrap;
}

.price-item-meta span {
    white-space: nowrap;
}

.price-item-right {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.price-item-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    direction: ltr;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price-item-value small {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 400;
}

.price-item-change {
    font-size: 0.75rem;
    font-weight: 700;
    direction: ltr;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
}

.price-item-change.up {
    color: var(--success);
    background: rgba(0, 200, 83, 0.1);
}

.price-item-change.down {
    color: var(--danger);
    background: rgba(255, 23, 68, 0.1);
}

.price-item-change.neutral {
    color: var(--text-dim);
    background: rgba(136, 136, 136, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .price-item {
        padding: 12px 14px;
        gap: var(--space-sm);
    }
    
    .price-item-value {
        font-size: 0.95rem;
    }
    
    .price-item-name {
        font-size: 0.85rem;
    }
    
    .category-tab {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .bubble-item {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Skeleton Loading
   ═══════════════════════════════════════════════════════════════ */

.price-item.skeleton {
    height: 70px;
    background: linear-gradient(
        90deg,
        var(--bg-light) 0%,
        var(--bg-hover) 50%,
        var(--bg-light) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}