/* Global Styles & Variables */
:root {
    /* Light Mode (Default: Minimalist White Card) */
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-hover: #f1f5f9;
    --bg-zebra: #f8fafc;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    
    /* Positive (Red/Up/Buy) */
    --color-up: #e11d48;
    --bg-up: rgba(225, 29, 72, 0.06);
    --border-up: rgba(225, 29, 72, 0.15);
    
    /* Negative (Green/Down/Sell) */
    --color-down: #059669;
    --bg-down: rgba(5, 150, 105, 0.06);
    --border-down: rgba(5, 150, 105, 0.15);

    --accent-blue: #3b82f6;
    --radius-lg: 10px;
    --radius-md: 6px;
    --transition-fast: 0.15s ease;
}

[data-theme="dark"] {
    /* Dark Mode (Sleek Dark Card) */
    --bg-primary: #0f172a;
    --bg-card: #1e293b;
    --bg-header: #1e293b;
    --border-color: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --bg-hover: #334155;
    --bg-zebra: #1e293b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    
    /* Positive (Red/Up/Buy) */
    --color-up: #fb7185;
    --bg-up: rgba(244, 63, 94, 0.08);
    --border-up: rgba(244, 63, 94, 0.15);
    
    /* Negative (Green/Down/Sell) */
    --color-down: #34d399;
    --bg-down: rgba(16, 185, 129, 0.08);
    --border-down: rgba(16, 185, 129, 0.15);

    --accent-blue: #60a5fa;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* Header Styles */
.main-header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.app-title {
    font-size: 20px;
    font-weight: 700;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    padding-right: 36px;
    font-size: 13px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--accent-blue);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
    opacity: 0.6;
}

.theme-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: background-color var(--transition-fast);
}

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

/* Main Content Layout */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cards & Layout */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

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

.card-title {
    font-size: 15px;
    font-weight: 600;
}

.card-title-unit {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

.date-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    padding: 4px 8px;
    border-radius: var(--radius-md);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

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

/* Two-column layout for dashboard */
.dashboard-two-column-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.dashboard-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (min-width: 1024px) {
    .dashboard-two-column-layout {
        grid-template-columns: 1fr 1fr;
    }
}

.market-parallel-tables {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .market-parallel-tables {
        grid-template-columns: 1fr 1fr;
    }
}

.table-subtitle {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 6px;
}

#apply-streak-btn:hover {
    background-color: #2563eb !important;
}

/* Tables Styles */
.table-container {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

th {
    padding: 10px 14px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

tr {
    transition: background-color var(--transition-fast);
}

tbody tr:hover {
    background-color: var(--bg-hover);
}

/* Text alignment utilities */
.text-right {
    text-align: right;
}

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

/* Badge & Streaks styles */
.badge-up, .badge-down {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.badge-up {
    background-color: var(--bg-up);
    color: var(--color-up);
    border: 1px solid var(--border-up);
}

.badge-down {
    background-color: var(--bg-down);
    color: var(--color-down);
    border: 1px solid var(--border-down);
}

/* Chart Styles */
.chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.futures-chart {
    width: 100%;
    /*max-height: 350px;*/
    object-fit: contain;
}

.chart-fallback-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Tab Styles */
.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.tabs-header::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.tab-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

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

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    font-weight: 600;
}

.tab-content {
    display: none;
}

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

/* Options & Analysis Grid */
.options-analysis-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settlement-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
}

.settlement-banner.alert {
    background-color: var(--bg-up);
    color: var(--color-up);
    border: 1px solid var(--border-up);
}

.settlement-banner.neutral {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.options-oi-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.options-card {
    display: flex;
    flex-direction: column;
    padding: 14px;
    border-radius: var(--radius-md);
}

.options-card.call {
    background-color: var(--bg-up);
    border: 1px solid var(--border-up);
}

.options-card.put {
    background-color: var(--bg-down);
    border: 1px solid var(--border-down);
}

.options-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.options-strike {
    font-size: 20px;
    font-weight: 700;
    margin: 4px 0;
}

.options-card.call .options-strike {
    color: var(--color-up);
}

.options-card.put .options-strike {
    color: var(--color-down);
}

.options-oi {
    font-size: 12px;
    color: var(--text-secondary);
}

.market-analysis-card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.analysis-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.analysis-content {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Stock Detail Search Box Card */
#stock-detail-section {
    border-left: 4px solid var(--accent-blue);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

.stock-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.stock-price-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.stock-price-main {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.stock-price-value {
    font-size: 28px;
    font-weight: 700;
}

.stock-price-change {
    font-size: 15px;
    font-weight: 600;
}

.stock-meta-info {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.stock-meta-info .badge {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.stock-ohl-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 480px) {
    .stock-ohl-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.ohl-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.ohl-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.ohl-value {
    font-size: 14px;
    font-weight: 600;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.stock-streaks-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 480px) {
    .stock-streaks-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .stock-streaks-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.streak-box {
    display: flex;
    flex-direction: column;
    padding: 14px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.streak-box-title {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.streak-box-value {
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}

.sbl-section-title {
    margin-top: 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    border-top: 1px dashed var(--border-color);
    padding-top: 16px;
}

.stock-sbl-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 480px) {
    .stock-sbl-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.sbl-summary-banner {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.sbl-summary-banner.bearish {
    background-color: rgba(225, 29, 72, 0.06);
    color: #e11d48;
    border-color: rgba(225, 29, 72, 0.15);
}

.sbl-summary-banner.bullish {
    background-color: rgba(5, 150, 105, 0.06);
    color: #059669;
    border-color: rgba(5, 150, 105, 0.15);
}

.hidden {
    display: none !important;
}

/* Footer styles */
.app-footer {
    background-color: var(--bg-header);
    border-top: 1px solid var(--border-color);
    padding: 24px 20px;
    margin-top: 40px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.page-btn {
    padding: 6px 12px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all var(--transition-fast);
    outline: none;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--bg-hover);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

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

.page-info {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Modal Backdrop Overlay */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    transition: opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Stock Detail Floating Modal */
.stock-detail-modal {
    position: fixed;
    z-index: 999;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Default Mode: Centered floating modal */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--accent-blue);
    opacity: 0;
    pointer-events: none;
}

.stock-detail-modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* Docked Right Mode (Overlay Drawer) */
.stock-detail-modal.docked-right {
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    width: 440px;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    transform: translateX(100%);
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-right: none;
    border-left: 4px solid var(--accent-blue);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
}

.stock-detail-modal.docked-right.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

/* Header Actions Styles */
.card-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dock-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

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

/* Docked Right specific layout adjustments to prevent horizontal scrollbars */
.stock-detail-modal.docked-right .stock-info-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
}

.stock-detail-modal.docked-right .stock-price-card {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    align-items: center;
    text-align: center;
}

.stock-detail-modal.docked-right .stock-price-main {
    justify-content: center;
}

.stock-detail-modal.docked-right .stock-meta-info {
    justify-content: center;
}

.stock-detail-modal.docked-right .stock-ohl-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

.stock-detail-modal.docked-right .stock-streaks-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Search Suggestions Autocomplete Dropdown */
.search-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1010;
    margin-top: 4px;
}

.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
}

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

.suggestion-item:hover,
.suggestion-item.active-suggestion {
    background-color: var(--bg-hover);
}

.suggestion-symbol {
    font-weight: 700;
    color: var(--accent-blue);
    font-variant-numeric: tabular-nums;
}

.suggestion-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-left: 8px;
    flex-grow: 1;
}

.suggestion-market {
    font-size: 10px;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Futures Tab Buttons Styling */
.futures-type-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-primary);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.futures-tab-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

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

.futures-tab-btn.active {
    background-color: var(--bg-card);
    color: var(--accent-blue);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    /* Hide the dock to right button on mobile because split drawer screen is too narrow */
    .dock-btn {
        display: none !important;
    }
    
    /* Override docked mode on mobile to force it to render as a centered floating modal */
    .stock-detail-modal.docked-right {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) scale(0.95) !important;
        width: 90% !important;
        max-width: 550px !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: var(--radius-lg) !important;
        border: 1px solid var(--border-color) !important;
        border-left: 4px solid var(--accent-blue) !important;
        box-shadow: var(--shadow-md) !important;
    }
    
    .stock-detail-modal.docked-right.active {
        transform: translate(-50%, -50%) scale(1) !important;
    }
    
    /* Stack card headers vertically on mobile/tablet for dashboard cards to avoid squishing */
    .card:not(.stock-detail-modal) .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .card:not(.stock-detail-modal) .card-header .card-title {
        text-align: center;
    }
    
    /* Futures type tabs full-width stretch on mobile/tablet */
    .futures-type-tabs {
        width: 100%;
        justify-content: center;
    }
    
    .futures-type-tabs .futures-tab-btn {
        flex: 1;
        text-align: center;
        padding: 6px 4px;
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    /* Adjust header layout to stack nicely on mobile */
    .header-container {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
        gap: 12px;
    }
    
    .app-title {
        font-size: 18px;
        text-align: center;
    }
    
    .header-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-box {
        flex-grow: 1;
        width: auto;
    }
    
    /* Reduce card padding slightly to maximize content space */
    .card {
        padding: 16px;
    }
    

    
    /* Reduce table cell padding to prevent overflow scroll on mobile */
    table th {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    /* Remove badge background/borders in futures table on mobile to save space */
    #futures-oi-table .badge-up,
    #futures-oi-table .badge-down {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        font-weight: 600;
    }
    
    /* Hide 'Industry' (3rd) and 'Market' (4th) columns in rankings tables on mobile to prevent scrolling entirely */
    #table-foreign-buy th:nth-child(3),
    #table-foreign-buy td:nth-child(3),
    #table-foreign-buy th:nth-child(4),
    #table-foreign-buy td:nth-child(4),
    #table-foreign-sell th:nth-child(3),
    #table-foreign-sell td:nth-child(3),
    #table-foreign-sell th:nth-child(4),
    #table-foreign-sell td:nth-child(4),
    #table-trust-buy th:nth-child(3),
    #table-trust-buy td:nth-child(3),
    #table-trust-buy th:nth-child(4),
    #table-trust-buy td:nth-child(4),
    #table-trust-sell th:nth-child(3),
    #table-trust-sell td:nth-child(3),
    #table-trust-sell th:nth-child(4),
    #table-trust-sell td:nth-child(4) {
        display: none !important;
    }
    
    /* Main container padding */
    .main-content {
        padding: 16px 12px;
    }
    
    /* Stack options Call & Put cards vertically */
    .options-oi-cards {
        grid-template-columns: 1fr;
    }
    
    /* Chart container aspect ratio scaling to fit phone screens without empty spaces */
    .chart-container {
        min-height: auto;
        aspect-ratio: 5 / 3;
        width: 100%;
    }
    
    .futures-chart {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

/* Watchlist Styles */
.watchlist-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.watchlist-placeholder {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.watchlist-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    user-select: none;
}

.watchlist-chip:hover {
    transform: translateY(-2px);
    background-color: var(--bg-hover);
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-md);
}

.watchlist-chip-title {
    font-weight: 600;
    color: var(--text-primary);
}

.watchlist-chip-price {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 2px;
}

.watchlist-chip-change {
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.watchlist-chip-remove {
    background: none;
    border: none;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    transition: all var(--transition-fast);
    margin-left: 2px;
}

.watchlist-chip-remove:hover {
    background-color: var(--bg-hover);
    color: var(--color-up);
}

/* Favorite Star Button Styles in Modal */
.favorite-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.favorite-btn:hover {
    background-color: var(--bg-hover);
    border-color: #eab308;
    color: #eab308;
}

.favorite-btn.active {
    color: #eab308;
    background-color: rgba(234, 179, 8, 0.08);
    border-color: #eab308;
}

/* Yahoo Link Button Styles in Modal */
.yahoo-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.yahoo-btn:hover {
    background-color: var(--bg-hover);
    border-color: #7b00d3;
    color: #7b00d3;
}

/* Intraday Live Indicator Banner */
.live-indicator-banner {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid rgba(217, 119, 6, 0.2);
    background-color: rgba(217, 119, 6, 0.05);
    color: #b45309; /* warm amber text */
    text-align: left;
}

/* ==========================================
   Google AdSense & Mock Ads Preview Styles
   ========================================== */

.ad-container {
    margin-bottom: 24px;
    width: 100%;
}

/* Specific margins for different sections */
.ad-top-leaderboard {
    margin-top: 8px;
    margin-bottom: 24px;
}

.ad-bottom-banner {
    margin-top: 24px;
    margin-bottom: 8px;
}

.ad-modal-rect {
    margin-top: 20px;
    margin-bottom: 8px;
}

/* Elegant header label for the ad slots */
.ad-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.7;
}

.ad-label::after {
    content: "";
    flex-grow: 1;
    height: 1px;
    border-bottom: 1px dotted var(--border-color);
    margin-left: 8px;
}

/* Premium Ad Card Mockup */
.ad-mockup {
    background-color: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.ad-mockup:hover {
    border-color: var(--accent-blue);
    background-color: var(--bg-hover);
}

/* Google Ad Badge */
.ad-badge {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 1px 4px;
    border-radius: 3px;
    display: inline-block;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--bg-primary);
    line-height: 1;
}

/* Ad content alignment (horizontal) */
.ad-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.ad-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.ad-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-blue);
    line-height: 1.3;
}

.ad-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Ad Call To Action Button */
.ad-cta-btn {
    background-color: var(--accent-blue);
    color: #ffffff !important;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    transition: all var(--transition-fast);
}

.ad-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    filter: brightness(1.08);
}

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

/* Stock Details Modal Ad (Rectangle Slot) */
.ad-rect-mockup {
    min-height: 180px;
    padding: 20px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ad-content-rect {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.ad-rect-mockup .ad-title {
    font-size: 15px;
    margin-top: 4px;
}

.ad-rect-mockup .ad-desc {
    font-size: 12px;
    max-width: 320px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.ad-rect-mockup .ad-badge {
    position: absolute;
    top: 12px;
    left: 12px;
}

@media (max-width: 768px) {
    .ad-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 14px;
    }
    
    .ad-mockup {
        padding: 16px;
        align-items: center;
    }
    
    .ad-info {
        align-items: center;
    }
    
    .ad-cta-btn {
        width: 100%;
        text-align: center;
    }
} 

.footer-container p {
    margin: 0;
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.instruction-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    padding: 24px;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.instruction-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    padding: 24px;
    box-sizing: border-box;
    grid-column: 1 / -1; 
    width: 100%;
    max-width: 100%;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.instruction-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    position: relative;
}

.instruction-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: var(--accent-blue);
}

.instruction-body {
    line-height: 1.7;
    color: var(--text-primary);
}

.instruction-subtitle {
    font-size: 14px;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 6px;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 6px;
}

.instruction-body p {
    margin-bottom: 12px;
    font-size: 13.5px;
    color: var(--text-primary);
}

.instruction-list {
    padding-left: 20px;
    font-size: 13.5px;
    margin-bottom: 16px;
}

.instruction-list li {
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

.instruction-summary-box {
    background-color: var(--bg-primary);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    border-left: 4px solid #f59e0b;
    margin-top: 18px;
    line-height: 1.6;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 576px) {
    .instruction-section {
        padding: 18px 16px;
    }
    .instruction-title {
        font-size: 15px;
    }
    .instruction-body p,
    .instruction-list {
        font-size: 13px;
    }
}
