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

:root {
    --stock-bg-dark: #0B0F19; /* Deeper, richer dark mode */
    --stock-card-bg: rgba(15, 23, 42, 0.45); /* Sleeker glass */
    --stock-border: rgba(255, 255, 255, 0.05);
    --stock-accent: #00E1FF; /* Vibrant Cyan */
    --stock-accent2: #9D4EDD; /* Vibrant Purple */
    --stock-bullish: #10B981; /* Emerald */
    --stock-bearish: #EF4444; /* Rose */
    --stock-neutral: #94A3B8; /* Slate */
    --glass-blur: blur(24px);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body.stocks-page {
    background-color: var(--stock-bg-dark);
    /* Animated Mesh Gradient Background */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 225, 255, 0.08), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(157, 78, 221, 0.08), transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.04), transparent 50%);
    background-attachment: fixed;
    color: #F8FAFC;
    font-family: var(--font-body);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Subtle texture overlay */
body.stocks-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.container { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ── Typography & Headings ── */
.stocks-hero {
    padding: 60px 0 40px;
    text-align: center;
    position: relative;
}

.stocks-hero h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 50%, #94A3B8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.stocks-hero p {
    font-size: 1.25rem;
    color: #94A3B8;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
    letter-spacing: -0.2px;
}

.section-heading {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #F8FAFC;
    position: relative;
    letter-spacing: -0.5px;
}

.section-heading::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background: linear-gradient(180deg, var(--stock-accent), var(--stock-accent2));
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(0, 225, 255, 0.4);
}

/* ── Glassmorphism Panels ── */
.glass-panel {
    background: var(--stock-card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--stock-border);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Stock Cards & Micro-Animations ── */
.top-stocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.stock-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 26px;
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stock-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 225, 255, 0.1);
    border-color: rgba(0, 225, 255, 0.3);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.8) 100%);
}

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

.stock-ticker {
    font-size: 1.8rem;
    font-weight: 800;
    color: #F8FAFC;
    font-family: var(--font-heading);
    letter-spacing: -0.5px;
}

.stock-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFFFFF;
    font-family: var(--font-heading);
}

.stock-name {
    color: #94A3B8;
    font-size: 0.95rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.stock-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 16px;
}

.stat-box { display: flex; flex-direction: column; gap: 4px; }

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748B;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value { font-size: 1.15rem; font-weight: 600; color: #E2E8F0; }

.bullish { color: var(--stock-bullish); }
.bearish { color: var(--stock-bearish); }
.neutral { color: var(--stock-neutral); }

/* ── Stock Search Spotlight UI ── */
.stock-search-container { margin: 32px auto 16px; max-width: 680px; position: relative; z-index: 100; }
.stock-search-wrapper { position: relative; display: flex; align-items: center; }

.search-icon { 
    position: absolute; left: 22px; font-size: 1.3rem; z-index: 2; pointer-events: none; opacity: 0.5; transition: opacity 0.3s;
}

.stock-search-input {
    width: 100%;
    padding: 20px 24px 20px 60px;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    color: #F8FAFC;
    font-size: 1.2rem;
    font-family: var(--font-body);
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}

.stock-search-input::placeholder { color: #64748B; font-weight: 400; }

.stock-search-input:focus {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(0, 225, 255, 0.4);
    box-shadow: 0 0 0 4px rgba(0, 225, 255, 0.1), 0 20px 40px rgba(0,0,0,0.4);
}

.stock-search-input:focus + .search-icon { opacity: 1; color: var(--stock-accent); }

.search-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0; right: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.05);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.search-dropdown::-webkit-scrollbar { width: 6px; }
.search-dropdown::-webkit-scrollbar-track { background: transparent; }
.search-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.2s;
    background: transparent;
}

.search-result-item:hover { 
    background: rgba(255, 255, 255, 0.06); 
    transform: translateX(4px);
}

.result-ticker {
    font-size: 1.2rem;
    font-weight: 800;
    color: #FFFFFF;
    font-family: var(--font-heading);
    min-width: 80px;
}

.result-info { flex: 1; min-width: 0; }
.result-name { font-size: 0.95rem; color: #CBD5E1; font-weight: 500; }
.result-meta { font-size: 0.75rem; color: #64748B; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.search-loading, .search-no-results { padding: 24px; text-align: center; color: #94A3B8; font-size: 1rem; font-weight: 500; }

/* ── Portfolio Tracker Polish ── */
.portfolio-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-item {
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94A3B8;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.summary-value { font-size: 1.75rem; font-weight: 800; color: #F8FAFC; font-family: var(--font-heading); letter-spacing: -0.5px; }

.portfolio-table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0 8px;
    font-size: 0.95rem; 
}

.portfolio-table th {
    text-align: left;
    padding: 0 16px 12px;
    color: #64748B;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    border: none;
}

.portfolio-table td { 
    padding: 16px; 
    background: rgba(30, 41, 59, 0.4);
    color: #E2E8F0; 
    border: 1px solid transparent;
}

.portfolio-table tbody tr {
    transition: all 0.2s;
}

.portfolio-table tbody tr td:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.portfolio-table tbody tr td:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

.portfolio-table tbody tr:hover td { 
    background: rgba(30, 41, 59, 0.8); 
    border-top-color: rgba(255,255,255,0.05);
    border-bottom-color: rgba(255,255,255,0.05);
}
.portfolio-table tbody tr:hover td:first-child { border-left-color: rgba(255,255,255,0.05); }
.portfolio-table tbody tr:hover td:last-child { border-right-color: rgba(255,255,255,0.05); }

/* Pill Badges for P&L */
.pill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.pill-badge.bullish {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pill-badge.bearish {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pt-ticker { font-weight: 800; color: #FFFFFF; cursor: pointer; transition: color 0.2s; font-family: var(--font-heading); font-size: 1.1rem; }
.pt-ticker:hover { color: var(--stock-accent); }
.pt-name { color: #94A3B8; font-size: 0.85rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

.btn-portfolio-action, .btn-alert-remove {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #94A3B8;
    width: 32px; height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}

.btn-portfolio-action:hover, .btn-alert-remove:hover { background: rgba(239, 68, 68, 0.15); color: #EF4444; }

.btn-portfolio-add {
    background: linear-gradient(135deg, rgba(0, 225, 255, 0.15) 0%, rgba(0, 150, 255, 0.15) 100%);
    border: 1px solid rgba(0, 225, 255, 0.3);
    color: var(--stock-accent);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-heading);
    box-shadow: 0 4px 12px rgba(0, 225, 255, 0.1);
}

.btn-portfolio-add:hover {
    background: linear-gradient(135deg, rgba(0, 225, 255, 0.25) 0%, rgba(0, 150, 255, 0.25) 100%);
    box-shadow: 0 8px 24px rgba(0, 225, 255, 0.2);
    transform: translateY(-2px);
}

.btn-portfolio-add.active {
    background: linear-gradient(135deg, rgba(0, 225, 255, 0.4) 0%, rgba(0, 150, 255, 0.4) 100%);
    border-color: var(--stock-accent);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(0, 225, 255, 0.3);
}

/* ── Stock Details View ── */
.stock-details-container { display: none; animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1); }

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

.stock-details-grid { display: grid; grid-template-columns: 1fr 380px; gap: 32px; }
.main-column, .side-column { display: flex; flex-direction: column; gap: 32px; }

.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.prediction-card {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s;
}

.prediction-card:hover { border-color: rgba(0, 225, 255, 0.3); background: rgba(30, 41, 59, 0.8); transform: translateY(-3px); }
.pred-time { font-size: 0.85rem; color: #94A3B8; margin-bottom: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.pred-price { font-size: 1.4rem; font-weight: 800; color: #F8FAFC; font-family: var(--font-heading); }

/* Trading Alerts */
.trading-alert {
    display: flex; align-items: center; padding: 16px 24px; border-radius: 16px;
    margin-top: 20px; font-size: 1.2rem; font-family: var(--font-heading); font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(15, 23, 42, 0.8);
    transition: all 0.3s ease; gap: 14px;
}
.alert-buy { color: #10B981; border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.1); }
.alert-sell { color: #EF4444; border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.1); }
.alert-hold { color: #94A3B8; border-color: rgba(148, 163, 184, 0.3); background: rgba(148, 163, 184, 0.05); }
.trading-alert.pulse { animation: alert-pulse 2s infinite; }

@keyframes alert-pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.2); }
    70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.alert-sell.pulse { animation: alert-pulse-sell 2s infinite; }
@keyframes alert-pulse-sell {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); }
    70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Model Selector */
.model-selector {
    display: flex; gap: 8px; background: rgba(15, 23, 42, 0.6); padding: 6px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.05); flex-wrap: wrap;
}
.model-btn {
    background: transparent; border: none; color: #94A3B8; padding: 8px 16px; border-radius: 8px;
    font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; font-family: var(--font-heading);
}
.model-btn:hover { color: #F8FAFC; background: rgba(255, 255, 255, 0.05); }
.model-btn.active { background: rgba(0, 225, 255, 0.15); color: var(--stock-accent); box-shadow: 0 0 16px rgba(0, 225, 255, 0.15); }

/* Modals */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(11, 15, 25, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
}

.modal-content {
    background: rgba(15, 23, 42, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 24px;
    width: 480px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255,255,255,0.05);
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header { padding: 30px 30px 10px; display: flex; justify-content: space-between; align-items: flex-start; }
.modal-header h3 { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 800; color: #F8FAFC; margin: 0; }
.modal-close { background: transparent; border: none; color: #64748B; font-size: 1.8rem; cursor: pointer; transition: color 0.2s; padding: 0; line-height: 1; margin-top: -5px; }
.modal-close:hover { color: #FFFFFF; }
.modal-body { padding: 20px 30px; }
.modal-footer { padding: 10px 30px 30px; display: flex; justify-content: flex-end; gap: 12px; }

/* Form Inputs */
.form-input {
    width: 100%; padding: 14px 18px; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px; color: #F8FAFC; font-size: 1rem; font-family: var(--font-body); font-weight: 500;
    transition: all 0.3s;
}
.form-input:focus { border-color: var(--stock-accent); background: rgba(0, 0, 0, 0.4); box-shadow: 0 0 0 3px rgba(0, 225, 255, 0.15); outline: none; }
.form-group label { display: block; font-size: 0.85rem; color: #94A3B8; margin-bottom: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.form-error { color: #EF4444; font-size: 0.85rem; margin-top: 8px; padding: 10px; background: rgba(239, 68, 68, 0.1); border-radius: 8px; }

/* Buttons */
.btn-back {
    display: inline-flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
    color: #CBD5E1; padding: 10px 22px; border-radius: 20px; cursor: pointer; font-weight: 600; margin-bottom: 24px; transition: all 0.3s; font-family: var(--font-heading);
}
.btn-back:hover { background: rgba(255, 255, 255, 0.1); transform: translateX(-4px); color: #FFFFFF; }
.btn-modal-cancel {
    background: transparent; border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94A3B8; padding: 10px 20px; border-radius: 12px; cursor: pointer;
    font-size: 0.9rem; font-weight: 600; transition: all 0.2s;
}
.btn-modal-cancel:hover { background: rgba(255, 255, 255, 0.05); color: #F8FAFC; }

.btn-modal-submit {
    background: linear-gradient(135deg, rgba(0, 225, 255, 0.15) 0%, rgba(0, 150, 255, 0.15) 100%); border: 1px solid rgba(0, 225, 255, 0.3);
    color: var(--stock-accent); padding: 10px 20px; border-radius: 12px;
    cursor: pointer; font-size: 0.9rem; font-weight: 700; transition: all 0.2s;
}
.btn-modal-submit:hover { background: linear-gradient(135deg, rgba(0, 225, 255, 0.25) 0%, rgba(0, 150, 255, 0.25) 100%); box-shadow: 0 0 20px rgba(0, 225, 255, 0.15); transform: translateY(-1px); }

.favorite-btn { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); color: #64748B; font-size: 1.4rem; cursor: pointer; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.favorite-btn:hover { background: rgba(255,255,255,0.05); color: #FBBF24; border-color: rgba(251, 191, 36, 0.4); }
.favorite-btn.active { color: #FBBF24; border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.15); box-shadow: 0 0 20px rgba(251, 191, 36, 0.2); text-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }

.alert-btn { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); color: #64748B; font-size: 1.3rem; cursor: pointer; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.alert-btn:hover { background: rgba(255,255,255,0.05); color: #FFFFFF; border-color: rgba(255,255,255,0.4); }

.btn-signals { font-size: 0.8rem; font-weight: 700; cursor: pointer; border-radius: 12px; padding: 8px 16px; transition: all 0.3s; font-family: var(--font-heading); border: 1px solid rgba(157, 78, 221, 0.3); background: rgba(157, 78, 221, 0.1); color: #D8B4FE; }
.btn-signals:hover { background: rgba(157, 78, 221, 0.2); box-shadow: 0 6px 20px rgba(157, 78, 221, 0.2); transform: translateY(-2px); }
.btn-short-signals { border-color: rgba(0, 225, 255, 0.3); background: rgba(0, 225, 255, 0.1); color: var(--stock-accent); }
.btn-short-signals:hover { background: rgba(0, 225, 255, 0.2); box-shadow: 0 6px 20px rgba(0, 225, 255, 0.2); }

/* Signal Badges */
.signal-badge {
    display: inline-flex; align-items: center; font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.8px; padding: 4px 12px; border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.badge-long { background: rgba(157, 78, 221, 0.15); color: #D8B4FE; border: 1px solid rgba(157, 78, 221, 0.3); }
.badge-short { background: rgba(0, 225, 255, 0.15); color: var(--stock-accent); border: 1px solid rgba(0, 225, 255, 0.3); }

/* Loading Spinner */
.loading-spinner { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px; }
.spinner { width: 44px; height: 44px; border: 4px solid rgba(255, 255, 255, 0.05); border-left-color: var(--stock-accent); border-radius: 50%; animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite; margin-bottom: 20px; box-shadow: 0 0 20px rgba(0, 225, 255, 0.2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Other Elements */
.news-item a { color: #E2E8F0; text-decoration: none; font-weight: 500; transition: color 0.2s; font-size: 1rem; }
.news-item a:hover { color: var(--stock-accent); }
.news-meta { color: #64748B; font-size: 0.8rem; margin-top: 8px; font-weight: 500; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-item { padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.news-item:last-child { border-bottom: none; }

.financials-list { display: flex; flex-direction: column; gap: 12px; }
.fin-item { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.fin-item:last-child { border-bottom: none; }
.fin-label { color: #94A3B8; font-size: 0.9rem; font-weight: 500; }
.fin-value { font-weight: 700; color: #F8FAFC; font-size: 1rem; }

/* ═══════════════════════════════════════
   Responsive — Tablets & Desktop narrow
   ═══════════════════════════════════════ */
@media (max-width: 1024px) {
    .stock-details-grid { grid-template-columns: 1fr; }
    .stocks-hero h1 { font-size: 3rem; }
    .portfolio-summary { grid-template-columns: 1fr 1fr; }
    .signal-modal-content { width: 90vw; }
}

/* ═══════════════════════════════════════
   Responsive — Mobile (≤ 768px)
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    /* Hero */
    .stocks-hero h1 { font-size: 2.2rem; }
    .stocks-hero p  { font-size: 1rem; }

    /* Search bar */
    .stock-search-input { font-size: 0.95rem; padding: 14px 44px 14px 44px; }

    /* Chart panel */
    .main-chart-panel { padding: 16px !important; }

    .chart-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .chart-controls {
        width: 100%;
        justify-content: flex-start !important;
    }

    /* Reduce chart heights on mobile */
    .main-chart-panel .chart-container:first-of-type { height: 220px !important; }
    .main-chart-panel .chart-container:nth-of-type(2) { height: 70px  !important; }
    .main-chart-panel .chart-container:nth-of-type(3) { height: 80px  !important; }

    /* Stock prediction cards in a tighter grid */
    .prediction-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .prediction-card { padding: 12px 8px; }
    .pred-time  { font-size: 0.7rem; }
    .pred-price { font-size: 1rem; }

    /* Portfolio */
    .portfolio-summary { grid-template-columns: 1fr; }
    .portfolio-table { font-size: 0.85rem; }

    /* Modals */
    .modal-content        { width: 95vw; padding: 24px 16px; }
    .signal-modal-content { width: 95vw; }

    /* Glass panels */
    .glass-panel { padding: 20px; }

    /* Alerts grid */
    .alerts-grid { grid-template-columns: 1fr; }

    /* Model selector buttons wrap */
    #model-selector { flex-wrap: wrap; gap: 6px; }
    #model-selector .model-btn { font-size: 0.75rem; padding: 6px 12px; }
}

/* ═══════════════════════════════════════
   Responsive — Small phones (≤ 480px)
   ═══════════════════════════════════════ */
@media (max-width: 480px) {
    .stocks-hero h1 { font-size: 1.8rem; }
    .container { padding: 0 12px; }
    .glass-panel { padding: 14px; border-radius: 16px; }

    /* Even smaller charts to avoid overflow */
    .main-chart-panel .chart-container:first-of-type { height: 180px !important; }
    .main-chart-panel .chart-container:nth-of-type(2) { height: 55px  !important; }
    .main-chart-panel .chart-container:nth-of-type(3) { height: 60px  !important; }

    /* Prediction cards: 2-column on tiny screens */
    .prediction-cards { grid-template-columns: repeat(2, 1fr); }

    /* Stock cards */
    .stock-card-ticker { font-size: 1.5rem; }
    .stock-card-price  { font-size: 1.6rem; }

    /* Btn controls stack vertically */
    .chart-controls { flex-direction: column; }
    .chart-controls .btn-portfolio-add { width: 100%; text-align: center; }
}

/* Signals Modals */
.signal-modal-content { width: 640px; }
.signal-modal-overview { background: linear-gradient(135deg, rgba(0, 225, 255, 0.05) 0%, rgba(157, 78, 221, 0.05) 100%); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 16px 20px; margin: 8px 0 24px; font-size: 0.9rem; color: #94A3B8; line-height: 1.6; }
.signal-modal-overview strong { color: #F8FAFC; }
.signals-grid { display: flex; flex-direction: column; gap: 16px; }
.signal-card { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.06); border-radius: 16px; padding: 24px; position: relative; overflow: hidden; transition: all 0.3s; }
.signal-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.15); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.signal-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.signal-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.signal-icon { width: 48px; height: 48px; font-size: 1.5rem; background: rgba(255,255,255,0.05); border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;}
.signal-name { font-size: 1.1rem; font-weight: 700; font-family: var(--font-heading); color: #F8FAFC; }
.signal-level { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.signal-score { font-size: 2rem; font-weight: 800; font-family: var(--font-heading); margin-left: auto; }
.signal-desc { font-size: 0.9rem; color: #94A3B8; line-height: 1.6; margin-top: 16px; }
.signal-bar-bg { height: 8px; background: rgba(255,255,255,0.05); border-radius: 4px; margin: 16px 0; overflow: hidden; }
.signal-bar-fill { height: 100%; border-radius: 4px; transition: width 1s cubic-bezier(0.16, 1, 0.3, 1); }

.signal-card[data-accent='green']::before { background: #10B981; }
.signal-card[data-accent='red']::before { background: #EF4444; }
.signal-card[data-accent='blue']::before { background: #00E1FF; }
.signal-card[data-accent='purple']::before { background: #9D4EDD; }
.signal-card[data-accent='orange']::before { background: #F59E0B; }
.signal-card[data-accent='pink']::before { background: #EC4899; }
.signal-card[data-accent='yellow']::before { background: #FBBF24; }

/* Alerts Grid */
.alerts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.alert-card { position: relative; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 20px; transition: all 0.3s; }
.alert-card:hover { border-color: rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.04); transform: translateY(-2px); }
.alert-card.alert-triggered { border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.05); }
.alert-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.alert-card-ticker { font-size: 1.25rem; font-weight: 800; color: #FFF; cursor: pointer; font-family: var(--font-heading); }
.alert-card-ticker:hover { color: var(--stock-accent); }
.alert-badge-active { font-size: 0.65rem; padding: 4px 12px; border-radius: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; background: rgba(0, 225, 255, 0.1); color: var(--stock-accent); border: 1px solid rgba(0, 225, 255, 0.2); }
.alert-badge-triggered { font-size: 0.65rem; padding: 4px 12px; border-radius: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; background: rgba(16, 185, 129, 0.1); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.3); }
.alert-card-name { font-size: 0.85rem; color: #94A3B8; margin-bottom: 12px; }
.alert-card-target, .alert-card-current { font-size: 0.95rem; color: #E2E8F0; }

.radio-label { flex: 1; padding: 12px 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; text-align: center; cursor: pointer; font-size: 0.95rem; font-weight: 500; color: #94A3B8; transition: all 0.2s; user-select: none; }
.radio-label:hover { border-color: rgba(255, 255, 255, 0.2); color: #CBD5E1; }
.radio-label.active { background: rgba(0, 225, 255, 0.1); border-color: var(--stock-accent); color: var(--stock-accent); box-shadow: inset 0 0 0 1px var(--stock-accent); }
