:root {
    --primary-color: #2563eb;
    --hot-color: #ef4444;
    --watch-color: #f59e0b;
    --success-color: #10b981;
    --filtered-color: #8b5cf6;
    --failed-color: #6b7280;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Navigation Bar */
.navbar {
    background: var(--bg-card);
    border-bottom: 2px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

.nav-brand {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 15px 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    padding: 20px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-menu a:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
}

.nav-menu a.active {
    color: var(--text-primary);
    border-bottom-color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 20px 20px;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.timestamp {
    display: inline-block;
    background: var(--bg-card);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.search-container {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-notification {
    margin-top: 15px;
    display: none;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.3s ease;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.search-notification.success {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.search-notification.error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.search-notification.info {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.redirect-btn {
    padding: 6px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.redirect-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

#ticker-search {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.05rem;
    width: 220px;
    text-transform: uppercase;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#ticker-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

#ticker-search::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

#search-button {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

#search-button:active {
    transform: translateY(0);
}

.search-message {
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 8px;
    min-width: 160px;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.summary-card {
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.summary-card.clickable {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.summary-card.clickable:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.summary-card.clickable .card-number {
    transition: transform 0.3s ease;
}

.summary-card.clickable:hover .card-number {
    transform: scale(1.1);
}

.card-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.card-content {
    flex: 1;
}

.card-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
}

.card-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.summary-card.hot .card-number {
    color: var(--hot-color);
}

.summary-card.watch .card-number {
    color: var(--watch-color);
}

.summary-card.filtered .card-number {
    color: var(--filtered-color);
}

.summary-card.analyzed .card-number {
    color: var(--success-color);
}

.summary-card.failed .card-number {
    color: var(--failed-color);
}

.results-section {
    margin-bottom: 50px;
}

.section-header {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid;
}

.hot-header {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--hot-color);
}

.watch-header {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--watch-color);
}

.failed-header {
    background: rgba(107, 114, 128, 0.1);
    border-left-color: var(--failed-color);
}

.section-header h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.stocks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Compact Stock Cards */
.stocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stock-card-compact {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    transition: all 0.25s ease;
    position: relative;
}

.stock-card-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 10px 0 0 10px;
}

.stock-card-compact:hover {
    background: var(--bg-card-hover);
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.stock-symbol {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.compare-selected-button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: auto;
}

.compare-selected-button:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.compare-selected-button:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.chart-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.chart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.stock-data {
    display: grid;
    gap: 6px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}

.data-row .label {
    color: var(--text-secondary);
}

.data-row .value {
    font-weight: 600;
    color: var(--text-primary);
}

.data-row .value.positive {
    color: var(--success-color);
}

.data-row .value.negative {
    color: var(--hot-color);
}

/* Page Info */
.page-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.result-count, .page-count {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.result-count span, .page-count span {
    font-weight: 700;
    color: var(--text-primary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
}

.page-btn:hover {
    background: var(--bg-card-hover);
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.page-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.page-ellipsis {
    color: var(--text-secondary);
    padding: 0 8px;
}

/* Failed Tickers Grid */
.failed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 30px;
}

.failed-ticker-item {
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.failed-ticker-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* Home Page Content */
.home-content {
    margin: 40px 0;
}

.welcome-section {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    max-width: 900px;
    margin: 0 auto;
}

.welcome-section h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    text-align: center;
}

.welcome-section p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}

.welcome-section p:last-child {
    margin-bottom: 0;
    margin-top: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.welcome-section strong {
    color: var(--text-primary);
}

.welcome-section h3 {
    font-size: 1.5rem;
    margin-top: 25px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.criteria-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.criteria-list li {
    padding: 12px 0 12px 30px;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.7;
}

.criteria-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: 700;
    font-size: 1.2rem;
}

.criteria-list strong {
    color: var(--text-primary);
}

/* Ad Placeholders */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    padding: 10px;
    width: 100%;
}

.ad-banner {
    min-height: 90px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    width: 100%;
}

.ad-placeholder {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    padding: 30px;
    opacity: 0.5;
}

/* Export Page Styles */
.export-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.export-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
}

.export-section h2 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.export-section p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.export-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.export-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

.export-btn.hot {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.export-btn.watch {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.export-btn.combined {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
}

.export-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.export-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-hot {
    background: rgba(239, 68, 68, 0.2);
    color: var(--hot-color);
}

.badge-watch {
    background: rgba(245, 158, 11, 0.2);
    color: var(--watch-color);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--hot-color);
    color: var(--hot-color);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
}

footer p {
    color: var(--text-secondary);
    margin: 5px 0;
}

.disclaimer {
    font-size: 0.85rem;
    font-style: italic;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .nav-container {
        flex-direction: column;
        padding: 0;
    }
    
    .nav-brand {
        width: 100%;
        text-align: center;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
        font-size: 1.1rem;
    }
    
    .nav-menu {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu a {
        padding: 10px 14px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .container {
        padding: 15px;
    }
    
    header {
        padding: 20px 10px 15px;
    }
    
    .search-container {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    #ticker-search {
        width: 100%;
        font-size: 1rem;
    }
    
    #search-button {
        width: 100%;
        padding: 12px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .summary-card {
        padding: 20px;
    }
    
    .card-icon {
        font-size: 2.5rem;
    }
    
    .card-number {
        font-size: 2rem;
    }
    
    .card-label {
        font-size: 0.9rem;
    }
    
    .card-description {
        font-size: 0.8rem;
    }
    
    .stocks-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stock-card-compact {
        padding: 12px;
    }
    
    .stock-symbol {
        font-size: 1.15rem;
    }
    
    .data-row {
        font-size: 0.82rem;
    }
    
    .failed-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 8px;
    }
    
    .failed-ticker-item {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .page-info {
        flex-direction: column;
        gap: 8px;
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .pagination {
        gap: 6px;
        margin: 20px 0;
    }
    
    .page-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
        min-width: 36px;
    }
    
    .welcome-section {
        padding: 25px 20px;
    }
    
    .welcome-section h2 {
        font-size: 1.5rem;
    }
    
    .welcome-section h3 {
        font-size: 1.2rem;
    }
    
    .welcome-section p {
        font-size: 0.95rem;
    }
    
    .criteria-list li {
        font-size: 0.9rem;
        padding-left: 25px;
    }
    
    .ad-container.ad-banner {
        min-height: 50px;
        margin: 15px 0;
    }
    
    .ad-placeholder {
        padding: 15px;
        font-size: 0.8rem;
    }
    
    .export-content {
        padding: 15px;
    }
    
    .export-section {
        padding: 20px;
    }
    
    .export-section h2 {
        font-size: 1.3rem;
    }
    
    .export-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .export-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    footer {
        padding: 20px 10px;
        font-size: 0.85rem;
    }
    
    .timestamp {
        font-size: 0.8rem;
        padding: 6px 14px;
    }
}

/* Market Overview Styles */
.market-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.market-section h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.market-section p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 25px;
}

.vix-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

.vix-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 15px;
    background: var(--bg-dark);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.legend-color.low {
    background: #10b981;
}

.legend-color.medium {
    background: #f59e0b;
}

.legend-color.high {
    background: #ef4444;
}

.sentiment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.sentiment-gauge {
    background: var(--bg-dark);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
}

.sentiment-gauge:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.gauge-value {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 20px 0 10px;
}

.gauge-label {
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sentiment-note {
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.sentiment-gauge.extreme-fear .gauge-value {
    color: #ef4444;
}

.sentiment-gauge.extreme-fear .gauge-label {
    color: #ef4444;
}

.sentiment-gauge.fear .gauge-value {
    color: #f59e0b;
}

.sentiment-gauge.fear .gauge-label {
    color: #f59e0b;
}

.sentiment-gauge.neutral .gauge-value {
    color: #6b7280;
}

.sentiment-gauge.neutral .gauge-label {
    color: #6b7280;
}

.sentiment-gauge.greed .gauge-value {
    color: #10b981;
}

.sentiment-gauge.greed .gauge-label {
    color: #10b981;
}

.sentiment-gauge.extreme-greed .gauge-value {
    color: #10b981;
}

.sentiment-gauge.extreme-greed .gauge-label {
    color: #10b981;
}

/* Fear & Greed Scale Gauge */
.gauge-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 25px;
    text-align: center;
}

.scale-gauge {
    position: relative;
    margin: 30px 20px;
}

.scale-bar {
    display: flex;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scale-segment {
    flex: 1;
    transition: opacity 0.3s ease;
}

.extreme-fear-bg {
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
}

.fear-bg {
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 100%);
}

.neutral-bg {
    background: linear-gradient(90deg, #f59e0b 0%, #6b7280 100%);
}

.greed-bg {
    background: linear-gradient(90deg, #6b7280 0%, #10b981 100%);
}

.extreme-greed-bg {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.scale-needle {
    position: absolute;
    top: -8px;
    width: 4px;
    height: 56px;
    background: white;
    transform: translateX(-50%);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: left 0.5s ease;
}

.scale-needle::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0 2px;
}

.gauge-value-display {
    text-align: center;
    margin: 25px 0 20px;
}

.gauge-current-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.gauge-current-label {
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.scale-legend {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.legend-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.gauge-placeholder {
    text-align: center;
    padding: 40px 20px;
}

.gauge-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Chart Viewer Styles */
.chart-search-container {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#chart-ticker-search {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.05rem;
    width: 220px;
    text-transform: uppercase;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#chart-ticker-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

#chart-search-button {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#chart-search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

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

.chart-info {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.candlestick-chart-container {
    position: relative;
    height: 500px;
    margin-bottom: 30px;
    background: var(--bg-dark);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.candlestick-chart-container canvas {
    max-width: 100%;
    height: 100% !important;
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: var(--bg-dark);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.chart-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Extra small phones */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .nav-brand {
        font-size: 1rem;
        padding: 8px 0;
    }
    
    .nav-menu a {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .card-icon {
        font-size: 2rem;
    }
    
    .card-number {
        font-size: 1.8rem;
    }
    
    .stock-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .chart-btn {
        align-self: stretch;
        text-align: center;
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    .badge {
        align-self: flex-start;
    }
    
    .page-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
        min-width: 32px;
    }
    
    .page-ellipsis {
        padding: 0 4px;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .vix-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    .vix-legend {
        gap: 15px;
        padding: 12px;
    }
    
    .legend-item {
        font-size: 0.85rem;
    }
    
    .legend-color {
        width: 20px;
        height: 20px;
    }
    
    .sentiment-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sentiment-gauge {
        padding: 20px;
    }
    
    .gauge-value {
        font-size: 2.5rem;
    }
    
    .gauge-label {
        font-size: 1rem;
    }
    
    .scale-gauge {
        margin: 20px 10px;
    }
    
    .scale-bar {
        height: 30px;
    }
    
    .scale-needle {
        height: 46px;
        top: -8px;
    }
    
    .gauge-current-value {
        font-size: 2.2rem;
    }
    
    .gauge-current-label {
        font-size: 1rem;
    }
    
    .scale-legend {
        flex-direction: column;
        gap: 8px;
    }
    
    .legend-label {
        font-size: 0.75rem;
    }
    
    .candlestick-chart-container {
        height: 350px;
        padding: 15px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .chart-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .chart-legend {
        flex-direction: column;
        gap: 12px;
    }
}

/* ===========================
   Stock Comparison Styles
   =========================== */

.compare-selection-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.compare-selection-section h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.compare-search-container {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.compare-search-container input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.compare-search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.compare-search-container button {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.compare-search-container button:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.selected-stocks-container {
    min-height: 60px;
    padding: 15px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.no-selection {
    color: var(--text-secondary);
    font-style: italic;
    width: 100%;
    text-align: center;
}

.stock-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--primary-color);
    border-radius: 20px;
    color: white;
    font-weight: 600;
}

.stock-chip-symbol {
    font-size: 1rem;
}

.stock-chip-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.stock-chip-remove:hover {
    background: rgba(255, 255, 255, 0.3);
}

.compare-action-button {
    width: 100%;
    padding: 16px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.compare-action-button:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
}

.compare-action-button:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.comparison-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.comparison-section h2 {
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.comparison-section h3 {
    color: var(--text-primary);
    margin: 30px 0 20px;
    font-size: 1.4rem;
}

.comparison-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-dark);
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.comparison-table td.metric-label {
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    width: 200px;
}

.comparison-table td {
    color: var(--text-primary);
    font-size: 1rem;
}

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

.status-hot {
    color: var(--hot-color);
    font-weight: 700;
}

.status-watch {
    color: var(--watch-color);
    font-weight: 700;
}

.status-other {
    color: var(--text-secondary);
    font-weight: 700;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.chart-wrapper {
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chart-title {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 700;
}

.chart-wrapper canvas {
    height: 300px !important;
}

/* Mobile Responsiveness for Comparison */
@media (max-width: 768px) {
    .compare-selection-section,
    .comparison-section {
        padding: 20px;
    }
    
    .compare-search-container {
        flex-direction: column;
    }
    
    .comparison-table {
        font-size: 0.9rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 10px 8px;
    }
    
    .comparison-table td.metric-label {
        width: 120px;
        font-size: 0.85rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-wrapper canvas {
        height: 250px !important;
    }
}

