/* ============================================
   CryptoSabs — Dark Silicon Valley Startup UI
   ============================================ */

/* Reset & Variables */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #16161f;
    --bg-card: #1a1a25;
    --bg-hover: #1f1f2e;
    --bg-input: #13131c;
    
    --border-primary: #1e1e2e;
    --border-secondary: #2a2a3d;
    --border-focus: #6366f1;
    
    --text-primary: #f0f0f5;
    --text-secondary: #9d9db5;
    --text-tertiary: #6b6b85;
    --text-muted: #4a4a62;
    
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    
    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.1);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);
    --yellow: #eab308;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s ease;
}

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

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden {
    display: none !important;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 15s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: #6366f1;
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: #8b5cf6;
    bottom: -150px;
    left: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: #a855f7;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 10px) scale(1.02); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: rgba(17, 17, 24, 0.8);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    margin-bottom: 16px;
    display: inline-block;
}

.login-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 44px 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.toggle-pw {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: var(--transition);
}

.toggle-pw:hover {
    color: var(--text-secondary);
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary.small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.login-error {
    color: var(--red);
    font-size: 0.82rem;
    text-align: center;
    min-height: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-primary);
}

.login-footer p {
    color: var(--text-muted);
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.login-footer p::before {
    content: '🔒';
    font-size: 0.7rem;
}

/* Shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* ============================================
   DASHBOARD
   ============================================ */

.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(17, 17, 24, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-center {
    flex: 1;
    max-width: 380px;
    margin: 0 24px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.88rem;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.last-updated {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-right: 8px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    padding: 18px 24px;
}

.stat-card {
    padding: 18px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Controls Bar */
.controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.period-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

.period-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.period-tab.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.sort-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.sort-active {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

.period-tab.sort-desc,
.period-tab.sort-asc {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}

/* Table */
.table-container {
    flex: 1;
    padding: 0 24px;
    overflow-x: auto;
}

.crypto-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.crypto-table thead th {
    padding: 12px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    white-space: nowrap;
}

.th-rank { width: 50px; text-align: center; }
.th-name { min-width: 180px; }
.th-price { min-width: 110px; text-align: right; }
.th-change { min-width: 90px; text-align: right; }
.th-mcap { min-width: 130px; text-align: right; }
.th-volume { min-width: 120px; text-align: right; }
.th-spark { min-width: 120px; text-align: center; }

.clickable-th {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.clickable-th:hover {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.clickable-th.active-th {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.06);
}

.crypto-table tbody tr {
    transition: var(--transition);
    cursor: default;
}

.crypto-table tbody tr:hover {
    background: var(--bg-hover);
}

.crypto-table tbody td {
    padding: 14px;
    border-bottom: 1px solid var(--border-primary);
    white-space: nowrap;
}

.td-rank {
    text-align: center;
    font-weight: 600;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

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

.coin-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.coin-details {
    display: flex;
    flex-direction: column;
}

.coin-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.coin-symbol {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.td-price {
    text-align: right;
    font-weight: 600;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.td-change {
    text-align: right;
    font-weight: 600;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.change-positive {
    color: var(--green);
}

.change-negative {
    color: var(--red);
}

.change-neutral {
    color: var(--text-tertiary);
}

.change-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
}

.change-badge.positive {
    background: var(--green-bg);
    color: var(--green);
}

.change-badge.negative {
    background: var(--red-bg);
    color: var(--red);
}

.td-mcap, .td-volume {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.td-spark {
    text-align: center;
}

.sparkline-svg {
    width: 100px;
    height: 35px;
}

/* Highlighted column */
.highlight-col {
    background: rgba(99, 102, 241, 0.04);
}

/* Loading & Error States */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.loading-state p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-secondary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.error-state p {
    color: var(--text-secondary);
}

/* Footer */
.dashboard-footer {
    padding: 20px 24px 96px;
    text-align: center;
    border-top: 1px solid var(--border-primary);
    margin-top: 24px;
}

.dashboard-footer p {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.dashboard-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
}

.dashboard-footer a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

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

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

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .stats-bar {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   ROW ENTRANCE ANIMATION
   ============================================ */

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

.crypto-table tbody tr {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

/* ============================================
   COMPARE CHECKBOX IN TABLE
   ============================================ */

.th-check {
    width: 42px;
    text-align: center;
}

.th-check-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: default;
}

.td-check {
    text-align: center;
}

.compare-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
    border-radius: 4px;
}

/* ============================================
   COMPARE BUTTON (Topbar)
   ============================================ */

.btn-compare {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-compare:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
}

/* ============================================
   COMPARE FLOATING BAR
   ============================================ */

.compare-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    max-width: 92vw;
    animation: slideUp 0.3s ease;
}

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

.compare-bar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(22, 22, 31, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 30px rgba(99,102,241,0.1);
}

.compare-bar-coins {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 65vw;
    max-height: 84px;
    overflow-y: auto;
}

.compare-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.compare-chip img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.compare-chip-remove {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 2px;
    margin-left: 2px;
    transition: var(--transition);
}

.compare-chip-remove:hover {
    color: var(--red);
}

.compare-vs {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-primary);
    padding: 0 2px;
}

.compare-bar-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ghost {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-ghost.small, .btn-primary.small {
    padding: 7px 12px;
    font-size: 0.8rem;
}

/* ============================================
   COMPARE MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-height: 92vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

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

.compare-modal {
    width: 95%;
    max-width: 1120px;
    padding: 28px;
}

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

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Compare Select Panel */
.compare-select-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.compare-select-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
}

.compare-instruction {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.compare-select-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.compare-coin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 8px;
    max-height: 440px;
    overflow-y: auto;
    padding: 4px;
}

.compare-coin-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
}

.compare-coin-btn:hover {
    border-color: var(--border-secondary);
    background: var(--bg-hover);
}

.compare-coin-btn.selected {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.12);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.compare-coin-btn img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.compare-coin-btn .coin-sym {
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    margin-left: auto;
}

/* Compare Results */
.compare-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.compare-results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.compare-winner-legend {
    font-size: 0.78rem;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.compare-headers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.compare-header-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.compare-header-card:hover {
    border-color: var(--border-secondary);
}

.ch-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.ch-remove-btn:hover {
    color: var(--red);
    border-color: var(--red);
    background: var(--red-bg);
}

.compare-header-card img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.compare-header-card .ch-name {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
}

.compare-header-card .ch-symbol {
    font-size: 0.74rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.compare-header-card .ch-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Compare Table */
.compare-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
}

.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.compare-table thead th {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
}

.compare-table thead th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg-tertiary);
}

.compare-table tr {
    transition: var(--transition);
}

.compare-table tbody tr:hover {
    background: var(--bg-hover);
}

.compare-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.86rem;
}

.compare-table tbody tr:last-child td {
    border-bottom: none;
}

.compare-table .ct-label {
    color: var(--text-tertiary);
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    position: sticky;
    left: 0;
    background: var(--bg-secondary);
    z-index: 1;
    border-right: 1px solid var(--border-primary);
}

.compare-table tbody tr:hover .ct-label {
    background: var(--bg-hover);
}

.compare-table .ct-val {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 130px;
}

.compare-table .ct-val.winner {
    background: rgba(99, 102, 241, 0.08);
    position: relative;
}

.winner-star {
    display: inline-block;
    color: var(--accent-primary);
    font-size: 0.78rem;
    margin-right: 4px;
}

.ct-cell-bar {
    width: 100%;
    height: 3px;
    background: var(--border-primary);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.ct-cell-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* ============================================
   NEW FEATURES: PORTFOLIO, ALARMS, HEATMAP,
   FEAR & GREED, TRADINGVIEW, MCAP CALCULATOR
   ============================================ */

.btn-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-action:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

.badge-pill {
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
}

.stat-sub {
    font-size: 0.74rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.clickable-stat {
    cursor: pointer;
}

.clickable-stat:hover {
    border-color: var(--accent-primary);
}

.stat-value-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fng-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.fng-bar-bg {
    width: 100%;
    height: 5px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.fng-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #ef4444, #eab308, #22c55e);
    transition: width 0.5s ease;
}

/* Category & View Toggle Row */
.filters-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.category-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cat-tab {
    padding: 6px 13px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.cat-tab:hover {
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

.cat-tab.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.view-toggle {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 3px;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.view-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

/* Favorites & Table Actions */
.th-fav, .td-fav {
    width: 36px;
    text-align: center;
}

.fav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    cursor: pointer;
    transition: var(--transition);
}

.fav-btn:hover {
    color: var(--yellow);
    transform: scale(1.15);
}

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

.th-actions, .td-actions {
    text-align: center;
    width: 90px;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.row-action-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.78rem;
}

.row-action-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: var(--bg-hover);
}

.coin-info.clickable-coin {
    cursor: pointer;
}

.coin-info.clickable-coin:hover .coin-name {
    color: var(--accent-primary);
}

.holding-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.14);
    color: var(--accent-primary);
    margin-left: 6px;
}

/* Heatmap View */
.heatmap-container {
    padding: 0 24px 24px;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    grid-auto-rows: 115px;
    gap: 8px;
}

.heatmap-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.heatmap-tile:hover {
    transform: scale(1.03);
    z-index: 5;
    box-shadow: 0 8px 25px rgba(0,0,0,0.45);
}

.heatmap-tile.large-tile {
    grid-column: span 2;
    grid-row: span 2;
}

.heatmap-tile img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-bottom: 6px;
}

.heatmap-tile.large-tile img {
    width: 42px;
    height: 42px;
}

.hm-sym {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
}

.heatmap-tile.large-tile .hm-sym {
    font-size: 1.35rem;
}

.hm-price {
    font-size: 0.76rem;
    color: rgba(255,255,255,0.8);
    margin-top: 2px;
}

.hm-chg {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    margin-top: 4px;
}

.heatmap-tile.large-tile .hm-chg {
    font-size: 1.15rem;
}

/* Modal Tabs */
.modal-tabs-header {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-tab-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.modal-tab-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
}

/* Market Cap Calculator */
.mcap-calc-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mcap-selectors {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
}

.mcap-select-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mcap-select-box label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.mcap-select-box select,
.pf-form-bar select,
.pf-form-bar input {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.88rem;
    outline: none;
}

.mcap-arrow, .mcap-swap-btn {
    font-size: 1.25rem;
    color: var(--accent-primary);
    margin-top: 18px;
}

.mcap-calc-result {
    padding: 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    text-align: center;
}

.mcap-res-headline {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.mcap-res-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.mcap-res-mult {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 800;
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.mcap-res-mult.down {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.mcap-res-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-primary);
}

/* TradingView / Chart Modal */
.chart-modal {
    width: 95%;
    max-width: 1050px;
    padding: 24px;
}

.chart-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
}

.chart-modal-title img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.chart-stats-strip {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.cs-item {
    display: flex;
    flex-direction: column;
}

.cs-label {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.cs-val {
    font-size: 0.92rem;
    font-weight: 700;
}

.chart-container {
    width: 100%;
    height: 480px;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Portfolio, Alarms & Add Coin Modals */
.portfolio-modal, .alarms-modal, .addcoin-modal {
    width: 95%;
    max-width: 920px;
    padding: 28px;
}

.portfolio-top-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.portfolio-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.pf-stat-box {
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pf-label {
    font-size: 0.74rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.pf-val {
    font-size: 1.2rem;
    font-weight: 700;
}

.portfolio-donut-box {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.76rem;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.donut-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pf-form-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
}

.pf-form-bar input, .pf-form-bar select {
    flex: 1;
    min-width: 150px;
}

/* Add Coin Search Results & Chips */
.cg-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
    max-height: 220px;
    overflow-y: auto;
}

.cg-result-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
}

.cg-result-info {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.cg-result-info img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.sub-heading {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.managed-coins-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 76px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(22, 22, 31, 0.96);
    border-left: 4px solid var(--accent-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 0.85rem;
    min-width: 280px;
    animation: fadeIn 0.25s ease;
}

/* ============================================
   FULL MOBILE & TABLET RESPONSIVENESS
   ============================================ */

.mobile-bottom-nav,
.mob-mcap-sub {
    display: none;
}

@media (max-width: 900px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .portfolio-top-grid, .mcap-selectors {
        grid-template-columns: 1fr;
    }
    .mcap-swap-btn {
        margin: 4px auto;
        transform: rotate(90deg);
    }
}

@media (max-width: 768px) {
    /* Login Screen */
    .login-container {
        margin: 16px;
        padding: 28px 22px;
    }

    .input-wrapper input {
        font-size: 16px;
    }

    /* Topbar: Ultra-Clean Mobile Header (Logo + Refresh/Logout + Search) */
    .topbar {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .topbar-left {
        gap: 8px;
    }

    .topbar-title {
        font-size: 1.15rem;
    }

    .last-updated,
    .topbar-right .btn-action,
    .topbar-right .btn-compare {
        display: none !important;
    }

    .topbar-right {
        gap: 6px;
    }

    .btn-icon {
        width: 34px;
        height: 34px;
    }

    .topbar-center {
        order: 3;
        max-width: 100%;
        margin: 0;
        flex-basis: 100%;
    }

    .search-box {
        padding: 8px 12px;
    }

    .search-box input {
        font-size: 16px;
    }

    /* Stats Bar: Compact Horizontal Swipe Strip */
    .stats-bar {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding: 10px 14px;
    }

    .stats-bar::-webkit-scrollbar {
        display: none;
    }

    .stat-card {
        flex: 0 0 148px;
        scroll-snap-align: start;
        padding: 10px 12px;
        border-radius: var(--radius-md);
    }

    .stat-label {
        font-size: 0.65rem;
        margin-bottom: 3px;
    }

    .stat-value {
        font-size: 0.98rem;
    }

    .stat-sub {
        font-size: 0.64rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Category Filters & View Toggle */
    .filters-row {
        padding: 0 14px 8px;
        gap: 8px;
    }

    .category-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

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

    .cat-tab {
        flex-shrink: 0;
        padding: 6px 12px;
        font-size: 0.74rem;
    }

    .view-toggle {
        width: 100%;
    }

    .view-btn {
        flex: 1;
        justify-content: center;
        padding: 6px 10px;
    }

    /* Period Tabs: Full-Width 5-Column Grid */
    .controls-bar {
        padding: 0 14px 8px;
    }

    .period-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 3px;
    }

    .period-tab {
        padding: 7px 4px;
        font-size: 0.76rem;
        text-align: center;
    }

    .sort-indicator {
        display: none;
    }

    /* Table View on Mobile: Fits 100% Width, ZERO Horizontal Clutter! */
    .table-container {
        padding: 0 10px;
        overflow-x: hidden;
    }

    .desktop-only-col,
    .th-change:not(.active-period-col),
    .td-change:not(.active-period-col) {
        display: none !important;
    }

    .mob-mcap-sub {
        display: inline;
        color: var(--text-muted);
        font-weight: 500;
        text-transform: none;
    }

    .crypto-table thead th {
        padding: 8px 6px;
        font-size: 0.68rem;
    }

    .crypto-table tbody td {
        padding: 11px 6px;
        font-size: 0.82rem;
    }

    .th-fav, .td-fav {
        width: 24px;
        padding: 8px 2px !important;
    }

    .th-rank, .td-rank {
        width: 24px;
        font-size: 0.72rem;
        padding: 8px 2px !important;
    }

    .th-name {
        min-width: 0;
        width: auto;
    }

    .th-price {
        min-width: 0;
    }

    .th-change.active-period-col {
        min-width: 0;
    }

    .coin-info {
        gap: 8px;
    }

    .coin-icon {
        width: 28px;
        height: 28px;
    }

    .coin-name {
        font-size: 0.84rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .holding-pill {
        display: inline-block;
        margin-left: 4px;
        font-size: 0.62rem;
        padding: 1px 4px;
    }

    .coin-symbol {
        font-size: 0.7rem;
    }

    .change-badge {
        padding: 3px 7px;
        font-size: 0.75rem;
    }

    /* Heatmap on Mobile */
    .heatmap-container {
        padding: 0 12px 16px;
    }

    .heatmap-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 96px;
        gap: 6px;
    }

    .heatmap-tile.large-tile {
        grid-column: span 2;
        grid-row: span 1;
    }

    /* Mobile Fixed Bottom Navigation Bar */
    .mobile-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 300;
        background: rgba(13, 13, 20, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-primary);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }

    .mob-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 4px 2px;
        background: none;
        border: none;
        color: var(--text-tertiary);
        font-family: var(--font);
        font-size: 0.65rem;
        font-weight: 600;
        cursor: pointer;
    }

    .mob-nav-item.active,
    .mob-nav-item:active {
        color: var(--accent-primary);
    }

    /* Modals: Mobile Bottom-Sheet Style */
    .modal-overlay {
        align-items: flex-end;
    }

    .modal-content,
    .compare-modal,
    .chart-modal,
    .portfolio-modal,
    .alarms-modal,
    .addcoin-modal {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        padding: 18px 14px 28px;
        border-radius: 18px 18px 0 0;
    }

    .modal-header {
        margin-bottom: 14px;
        gap: 8px;
    }

    .modal-header h2,
    .chart-modal-title {
        font-size: 0.98rem;
        flex-wrap: wrap;
    }

    .modal-tab-btn {
        padding: 6px 10px;
        font-size: 0.74rem;
        flex: 1;
        text-align: center;
    }

    .compare-select-top {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
    }

    .compare-select-actions {
        width: 100%;
    }

    .compare-select-actions button {
        flex: 1;
        justify-content: center;
    }

    .compare-coin-grid {
        grid-template-columns: repeat(2, 1fr);
        max-height: 320px;
    }

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

    .compare-header-card {
        padding: 12px 8px;
    }

    .compare-header-card img {
        width: 32px;
        height: 32px;
    }

    /* Portfolio & Forms on Mobile */
    .portfolio-summary-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .pf-stat-box {
        padding: 12px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .pf-label {
        margin-bottom: 0;
    }

    .pf-form-bar {
        flex-direction: column;
        padding: 12px;
        gap: 8px;
    }

    .pf-form-bar input,
    .pf-form-bar select,
    .mcap-select-box select {
        width: 100%;
        font-size: 16px;
    }

    .pf-form-bar button {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }

    .mcap-res-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .mcap-res-price {
        font-size: 1.65rem;
    }

    /* Chart Modal on Mobile */
    .chart-stats-strip {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 10px 12px;
    }

    .chart-container {
        height: 320px;
    }

    /* Toast on Mobile */
    .toast-container {
        top: 12px;
        left: 12px;
        right: 12px;
    }

    .toast-item {
        min-width: 0;
        width: 100%;
    }
}

/* ============================================
   BUNLU SEPETI STYLES
   ============================================ */

.cat-tab.bunlu-tab {
    border-color: rgba(234, 179, 8, 0.45);
    color: #facc15;
    background: rgba(234, 179, 8, 0.08);
}

.cat-tab.bunlu-tab:hover,
.cat-tab.bunlu-tab.active {
    background: linear-gradient(135deg, #eab308, #f59e0b);
    color: #0a0a0f;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 2px 14px rgba(234, 179, 8, 0.35);
}

.bunlu-banner {
    margin: 0 24px 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.bunlu-banner-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bunlu-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bunlu-badge {
    background: linear-gradient(135deg, #eab308, #f59e0b);
    color: #0a0a0f;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.bunlu-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.bunlu-mevduat-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.bunlu-mevduat-control input {
    width: 72px;
    padding: 4px 8px;
    background: var(--bg-input);
    border: 1px solid rgba(234, 179, 8, 0.45);
    border-radius: var(--radius-sm);
    color: #facc15;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.bunlu-mevduat-Summary {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--green);
    background: var(--green-bg);
    padding: 3px 8px;
    border-radius: 6px;
}

.bunlu-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bunlu-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(234, 179, 8, 0.18);
    color: #facc15;
    margin-left: 5px;
}

@media (max-width: 768px) {
    .bunlu-banner {
        margin: 0 12px 12px;
        padding: 12px 14px;
        flex-direction: column;
        align-items: stretch;
    }

    .bunlu-mevduat-control input {
        font-size: 16px;
    }

    .bunlu-banner-actions {
        width: 100%;
    }

    .bunlu-banner-actions button {
        flex: 1;
        justify-content: center;
    }
}
