:root {
    --bg-dark: #0f111a;
    --bg-card: #1a1d2d;
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --accent-green: #00ff9d;
    --accent-red: #ff3366;
    --accent-purple: #2563EB;
    --accent-blue: #00d4ff;
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(26, 29, 45, 0.6);
    --glow-green: 0 0 20px rgba(0, 255, 157, 0.3);
    --glow-red: 0 0 20px rgba(255, 51, 102, 0.3);
    --font-main: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Utilities */
.text-green {
    color: var(--accent-green);
}

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

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

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

.glow-text-green {
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.5);
}

.bg-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    padding: 0.75rem 0;
    /* Reduced from 1.5rem */
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(15, 17, 26, 0.8);
    backdrop-filter: blur(10px);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

/* Hero Section */
.hero {
    padding: 2rem 0 1rem;
    /* Reduced from 4rem and 2rem */
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 1.5rem;
    /* Reduced from 3rem */
}

/* Stats Cards */
.market-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    /* Reduced from 1.5rem */
    margin-bottom: 1.5rem;
    /* Reduced from 3rem */
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    min-width: 180px;
    z-index: 1000;
}

.dropdown-menu.active {
    display: flex;
}

.dropdown-menu a {
    color: var(--text-muted);
    padding: 0.6rem 1rem;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.dropdown-menu a:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-purple);
}

.dropdown-menu hr {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: 0.4rem 0;
}

.stat-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

/* Main Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Trending Table */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 0.6rem 1rem;
    /* Reduced from 1rem */
    background: var(--bg-card);
}

tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

tr {
    transition: transform 0.2s;
    cursor: pointer;
}

tr:hover {
    transform: scale(1.01);
}

.ticker-cell {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.ticker-icon {
    width: 24px;
    /* Reduced from 32px */
    height: 24px;
    border-radius: 50%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    color: var(--text-main);
}

.sentiment-bar {
    width: 100px;
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.sentiment-fill {
    height: 100%;
    border-radius: 3px;
}

/* Sidebar / News Feed */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 800px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.feed-container::-webkit-scrollbar {
    width: 6px;
}

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

.comment-card {
    padding: 1rem;
    border-left: 3px solid transparent;
}

.comment-card.bullish {
    border-left-color: var(--accent-green);
}

.comment-card.bearish {
    border-left-color: var(--accent-red);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.comment-body {
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

.tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

/* Trending Tickers Layout */
.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.trending-section {
    display: flex;
    flex-direction: column;
}

.trending-section .stat-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.condensed-table th,
.condensed-table td {
    padding: 0.75rem;
    font-size: 0.85rem;
}

.condensed-table .ticker-icon {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
}

.condensed-table .weighted-score {
    font-family: monospace;
    font-weight: bold;
}

/* Compact Table Styling for Widgets */
.ticker-table.compact {
    border-collapse: collapse;
    border-spacing: 0;
}

.ticker-table.compact th {
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--glass-border);
}

.ticker-table.compact td {
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    line-height: 1.2;
}

.ticker-table.compact tr td {
    border-radius: 0 !important;
}

.ticker-table.compact tr:last-child td {
    border-bottom: none;
}

.ticker-table.compact tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.ticker-table.compact .ticker-symbol {
    font-weight: 600;
    color: var(--text-main);
}

/* Tooltip System */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip-icon {
    font-size: 0.85em;
    opacity: 0.6;
    margin-left: 2px;
}

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: rgba(26, 29, 45, 0.98);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    font-weight: normal;
    text-transform: none;
    line-height: 1.4;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Tooltip Arrow */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--glass-border) transparent transparent transparent;
}

/* --- NEW LAYOUT OVERRIDES --- */

/* Updated Header */
.navbar {
    padding: 0.75rem 0;
    /* Reduced from 1.5rem */
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(15, 17, 26, 0.95);
    backdrop-filter: blur(10px);
    margin-bottom: 0;
}

.dashboard-v2 {
    padding-top: 3.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Responsive Grid for mobile */
@media (max-width: 1024px) {
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: var(--font-main);
    background: none;
    /* Reset gradient */
    -webkit-text-fill-color: var(--text-main);
}

.btn {
    border: none;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--accent-purple);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
    box-shadow: none;
}

.btn-primary:hover {
    background: #3b82f6;
}

/* 2-Column Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 2.5rem;
    padding-bottom: 4rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Column Wrappers */
.news-column,
.stats-column {
    display: flex;
    flex-direction: column;
}

/* Live Indicator */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent-green);
    background: rgba(0, 255, 157, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 157, 0.2);
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Stats Cards (Right Column Grid) */
.market-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 0;
}

.stat-card {
    padding: 1rem;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
}

.stat-title {
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
}

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

/* Timeframe Controls */
.timeframe-controls {
    display: flex;
    align-items: center;
}

.toggle-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem;
    border-radius: 8px;
    display: flex;
    gap: 0.2rem;
}

.toggle-btn {
    background: none;
    border: none;
    box-shadow: none;
    color: var(--text-muted);
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.toggle-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

/* Card Header Tweaks */
.card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.card-header h3 {
    font-size: 1rem;
    margin: 0;
}

/* News Feed Cards */
.feed-container {
    gap: 1.5rem;
    max-height: none;
    /* Let page scroll */
    overflow-y: visible;
}

.news-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s;
}

.news-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.news-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.news-source {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-weight: 500;
}

.news-title a {
    color: var(--text-main);
    text-decoration: none;
}

.news-title a:hover {
    color: var(--accent-purple);
}

.news-footer {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Sentiment Pills */
.ticker-tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.bg-tag-green {
    background: rgba(0, 255, 157, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 157, 0.2);
}

.bg-tag-red {
    background: rgba(255, 51, 102, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(255, 51, 102, 0.2);
}

.bg-tag-grey {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- V2 LAYOUT --- */

.dashboard-v2 {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    /* Reduced from 2rem */
    padding-bottom: 3rem;
}

.widgets-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

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

.widget-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.widget-body {
    flex-grow: 1;
}

/* News Table */
.news-table th {
    font-size: 0.8rem;
    /* Slightly smaller */
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
}

.news-table td {
    padding: 0.75rem 1rem;
    /* Reduced from 1rem */
    color: var(--text-main);
    background: transparent;
    /* Override default td background */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.news-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Time Lagged Column */
.time-lagged {
    font-family: monospace;
    color: var(--accent-blue);
    font-weight: bold;
}

/* News Link */
.news-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    font-size: 1rem;
}

.news-link:hover {
    color: var(--accent-purple);
}

/* Source Style */
.source-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- MODAL STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    background: #1a1d2d;
    /* Solid bg-card color */
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    animation: modalSlideUp 0.4s ease-out;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

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

.ticker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.ticker-title h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.ticker-subtitle {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.company-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
}

.info-item span {
    font-size: 1.1rem;
    font-weight: 500;
}

.description-box {
    margin-bottom: 2rem;
}

.description-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.chart-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
    min-height: 400px;
}

.clickable-ticker {
    cursor: pointer;
    transition: color 0.2s;
}

.clickable-ticker:hover {
    color: var(--accent-purple) !important;
}

/* --- TABBED MODAL STYLES --- */
.modal-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
}

.modal-tab-pane {
    display: none;
}

.modal-tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- TICKER SEARCH STYLES --- */
.search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.ticker-search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.9rem;
    transition: all 0.2s;
}

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

.ticker-search-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: rgba(255, 255, 255, 0.08);
}

.search-btn {
    background: var(--accent-purple);
    border: none;
    box-shadow: none;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-btn:hover {
    background: #3b82f6;
}

@media (max-width: 768px) {
    .search-container {
        max-width: 200px;
        margin: 0 1rem;
    }
}

/* --- AUTOCOMPLETE DROPDOWN STYLES --- */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 50px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.autocomplete-dropdown.active {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.autocomplete-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.autocomplete-item.selected {
    background: rgba(189, 0, 255, 0.1);
}

.autocomplete-ticker {
    font-weight: 600;
    color: var(--accent-purple);
}

.autocomplete-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-container {
    position: relative;
}

/* Auth Modal Styles */
.auth-modal-content {
    max-width: 400px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.auth-tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab-btn.active {
    color: var(--accent-purple);
    border-bottom: 2px solid var(--accent-purple);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.auth-error {
    color: var(--accent-red);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: center;
}

.nav-user-info {
    display: flex;
    align-items: center;
}

#user-display-name {
    font-weight: 500;
    color: var(--text-light);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.w-100 {
    width: 100%;
}

/* Portfolio Tags & Chips */
.portfolio-tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    min-height: 45px;
    align-items: center;
    position: relative;
    overflow: visible;
    /* Ensure dropdown is visible */
}

.ticker-chip {
    background: var(--accent-purple);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: popIn 0.2s ease-out;
}

.ticker-chip.selected {
    border: 2px solid var(--accent-green);
    background: rgba(0, 255, 157, 0.2);
}

.ticker-chip .remove-tag {
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ticker-chip .remove-tag:hover {
    opacity: 1;
}

.portfolio-input-wrapper {
    flex-grow: 1;
    min-width: 120px;
    position: relative;
    /* Base for autocomplete dropdown */
}

.portfolio-input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem;
    outline: none;
    font-family: inherit;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}