/**
 * Main Stylesheet - Core Dashboard Styles
 * Contains base styles, header, tabs, metrics bar, and common components
 */

/* ============================================================================
   BASE STYLES
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* ============================================================================
   HEADER & STATUS - Sleek Compact Design
   ============================================================================ */
.header {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    padding: 10px 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    border-top: 3px solid #1976d2;
    position: relative;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-icon {
    font-size: 18px;
}

.header-title-group {
    display: flex;
    flex-direction: column;
}

.header h1 {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.2px;
    margin-bottom: 0;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 10px;
    color: #666;
    font-weight: 500;
    margin-top: 2px;
    line-height: 1;
}

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

/* Token Status Badge */
.token-status-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.token-status-badge:hover {
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.token-status-badge.token-active {
    color: #2e7d32;
    border-color: rgba(76, 175, 80, 0.4);
}

.token-status-badge.token-warning {
    color: #e65100;
    background: rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.4);
}

.token-status-badge.token-expired {
    color: #c62828;
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.4);
}

.token-icon {
    font-size: 11px;
}

.token-time {
    font-size: 9px;
    opacity: 0.8;
}

/* WebSocket Status Badge */
.status {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #2e7d32;
    font-size: 10px;
    font-weight: 600;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4caf50;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0);
    }
}

.status.disconnected {
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.3);
    color: #c62828;
}

.status.disconnected::before {
    background: #f44336;
    animation: none;
}

.timestamp-badge {
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 4px;
    color: #666;
    font-size: 10px;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Market Status Badge */
.market-status-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(244, 67, 54, 0.3);
    font-size: 10px;
    font-weight: 600;
    color: #c62828;
    transition: all 0.3s ease;
}

.market-status-badge.market-open {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
    color: #2e7d32;
}

.market-status-icon {
    font-size: 10px;
    animation: statusBlink 2s ease-in-out infinite;
}

.market-status-badge.market-open .market-status-icon {
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.market-status-text {
    font-size: 10px;
    letter-spacing: 0.2px;
}

/* Token Status Popover */
.token-popover {
    position: absolute;
    top: 100%;
    right: 24px;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    width: 280px;
    z-index: 9999;
    display: none;
}

.token-popover.show {
    display: block;
    animation: popoverSlideIn 0.2s ease;
}

@keyframes popoverSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.token-popover-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    color: white;
    font-weight: 700;
    font-size: 13px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.token-popover-body {
    padding: 16px;
}

.token-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 11px;
}

.token-info-row:last-child {
    border-bottom: none;
}

.token-info-label {
    color: #666;
    font-weight: 500;
}

.token-info-value {
    color: #1a1a1a;
    font-weight: 600;
}

.token-info-value.status-active {
    color: #2e7d32;
}

.token-info-value.status-warning {
    color: #e65100;
}

.token-info-value.status-expired {
    color: #c62828;
}

.token-popover-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
}

.token-action-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.token-action-btn.primary {
    background: #1976d2;
    color: white;
}

.token-action-btn.primary:hover {
    background: #1565c0;
    box-shadow: 0 2px 6px rgba(25, 118, 210, 0.3);
}

.token-action-btn.secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

.token-action-btn.secondary:hover {
    background: #e8e8e8;
}

.token-action-btn.warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
}

.token-action-btn.warning:hover {
    background: #ffe0b2;
    border-color: #ff9800;
}

.token-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Token Refresh Modal */
.token-refresh-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.token-refresh-modal.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

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

.token-refresh-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.3s ease;
}

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

.token-refresh-header {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.token-refresh-body {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.token-refresh-progress {
    background: #f0f0f0;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.token-refresh-progress-bar {
    background: linear-gradient(90deg, #1976d2, #2196f3);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressShimmer 1.5s infinite;
}

@keyframes progressShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.token-refresh-status {
    font-size: 12px;
    color: #666;
    margin-bottom: 16px;
}

.token-refresh-status-item {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.token-refresh-status-item .icon {
    font-size: 14px;
}

.token-refresh-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.token-refresh-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.token-refresh-btn.cancel {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

.token-refresh-btn.cancel:hover {
    background: #e8e8e8;
}

.token-refresh-btn.confirm {
    background: #1976d2;
    color: white;
}

.token-refresh-btn.confirm:hover {
    background: #1565c0;
    box-shadow: 0 2px 6px rgba(25, 118, 210, 0.3);
}

.token-refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   TABS - Compact & Clean
   ============================================================================ */
.tabs-container {
    padding: 0 0 12px 0;
}

.tabs {
    background: white;
    border-radius: 6px;
    padding: 4px;
    display: flex;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
}

.tab {
    flex: 1;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab:hover {
    background: #f5f5f5;
    color: #333;
}

.tab.active {
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    color: white;
    box-shadow: 0 1px 3px rgba(25, 118, 210, 0.3);
}

.tab-content {
    display: none;
}

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

/* ============================================================================
   CONTENT & LAYOUT
   ============================================================================ */
.content {
    padding: 0;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* ============================================================================
   METRICS BAR - OLD (Replaced by Compact Control Bar)
   ============================================================================ */
.metrics-bar {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 20px;
    display: none;
    /* Hidden - replaced by compact control bar */
    gap: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8e8e8;
    position: relative;
    overflow: hidden;
}

/* Subtle accent line on top */
.metrics-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1976d2 0%, #42a5f5 100%);
}

.metric {
    flex: 1;
    position: relative;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.metric:hover {
    background: rgba(25, 118, 210, 0.03);
    transform: translateY(-1px);
}

/* Separator between metrics */
.metric:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -16px;
    top: 10%;
    height: 80%;
    width: 1px;
    background: linear-gradient(180deg, transparent 0%, #e0e0e0 25%, #e0e0e0 75%, transparent 100%);
}

.metric-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-label::before {
    content: '▸';
    color: #1976d2;
    font-size: 10px;
}

.metric-value {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.metric-value.positive {
    color: #2e7d32;
    text-shadow: 0 1px 2px rgba(46, 125, 50, 0.1);
}

.metric-value.negative {
    color: #c62828;
    text-shadow: 0 1px 2px rgba(198, 40, 40, 0.1);
}

.metric-subvalue {
    font-size: 12px;
    color: #777;
    margin-top: 4px;
    font-weight: 500;
    background: rgba(25, 118, 210, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 6px;
}

/* ============================================================================
   DASHBOARD LAYOUT - Sidebar + Main Content
   ============================================================================ */
.dashboard-layout {
    max-width: 1600px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* ============================================================================
   STICKY SIDEBAR - Market Overview Cards
   ============================================================================ */
.market-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 8px;
}

/* Custom scrollbar for sidebar */
.market-sidebar::-webkit-scrollbar {
    width: 6px;
}

.market-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.market-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.market-sidebar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Main Content Area */
.main-content-area {
    flex: 1;
    min-width: 0;
}

.overview-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    border-left: 4px solid;
    transition: all 0.2s ease;
}

.overview-card:hover {
    transform: translateX(2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

/* Card colors */
.pcr-card {
    border-left-color: #9c27b0;
}

.vix-card {
    border-left-color: #ff9800;
}

.balancer-card {
    border-left-color: #8d6e63;
}

.nifty-card {
    border-left-color: #283593;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.card-icon {
    font-size: 16px;
}

.card-title {
    font-size: 10px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1.3;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* PCR Card Specific Styles */
.pcr-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pcr-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #9c27b0;
}

.pcr-metric-label {
    font-size: 10px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pcr-metric-value {
    font-size: 16px;
    font-weight: 700;
    color: #9c27b0;
    line-height: 1;
}

.pcr-metric-atm {
    font-size: 8px;
    color: #999;
}

.pcr-summary-footer {
    text-align: center;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
}

.pcr-sentiment-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 10px;
    margin-left: 4px;
    letter-spacing: 0.3px;
}

.sentiment-bullish {
    background: #e8f5e9;
    color: #2e7d32;
}

.sentiment-bearish {
    background: #ffebee;
    color: #c62828;
}

.sentiment-neutral {
    background: #fff3e0;
    color: #e65100;
}

/* ============================================================================
   VIX DISPLAY - Card Style
   ============================================================================ */
.vix-display {
    text-align: center;
}

.vix-main-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
    margin-bottom: 6px;
}

.vix-change-info {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 6px;
}

.vix-change {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 3px;
}

.vix-change.positive {
    background: #ffebee;
    color: #c62828;
}

.vix-change.negative {
    background: #e8f5e9;
    color: #2e7d32;
}

.vix-level-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vix-level-low {
    background: #e8f5e9;
    color: #2e7d32;
}

.vix-level-medium {
    background: #fff3e0;
    color: #e65100;
}

.vix-level-high {
    background: #ffebee;
    color: #c62828;
}

/* ============================================================================
   MARKET BALANCER - Card Style
   ============================================================================ */
.balancer-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.balancer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 3px solid;
}

.balancer-advances {
    background: rgba(76, 175, 80, 0.08);
    border-left-color: #4caf50;
}

.balancer-declines {
    background: rgba(244, 67, 54, 0.08);
    border-left-color: #f44336;
}

.balancer-label {
    font-size: 11px;
    color: #666;
    font-weight: 600;
}

.balancer-value {
    font-size: 18px;
    font-weight: 700;
}

.balancer-value.advances {
    color: #2e7d32;
}

.balancer-value.declines {
    color: #c62828;
}

/* ============================================================================
   NIFTY TOP 8 CARD - Compact Display
   ============================================================================ */
.nifty-top8-summary {
    display: flex;
    justify-content: space-around;
    margin-bottom: 8px;
}

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

.top8-stat-label {
    font-size: 10px;
    color: #666;
    font-weight: 600;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.top8-stat-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.top8-stat-value.gainers {
    color: #2e7d32;
}

.top8-stat-value.losers {
    color: #c62828;
}

.expand-btn {
    width: 100%;
    padding: 6px;
    background: #f5f5f5;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    color: #666;
    font-weight: 600;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.expand-btn:hover {
    background: #e8e8e8;
    color: #333;
}

/* ============================================================================
   NIFTY 50 MODAL
   ============================================================================ */
.nifty-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.nifty-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.nifty-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 10001;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

.nifty-modal-header {
    background: linear-gradient(135deg, #283593 0%, #3949ab 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #1a237e;
}

.nifty-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nifty-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 32px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.nifty-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.nifty-modal-body {
    padding: 24px;
    max-height: calc(85vh - 80px);
    overflow-y: auto;
}

/* Scrollbar for modal body */
.nifty-modal-body::-webkit-scrollbar {
    width: 8px;
}

.nifty-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.nifty-modal-body::-webkit-scrollbar-thumb {
    background: #283593;
    border-radius: 4px;
}

.nifty-modal-body::-webkit-scrollbar-thumb:hover {
    background: #1a237e;
}

/* Modal sections for gainers/losers */
.modal-section {
    margin-bottom: 24px;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 8px;
    margin-bottom: 12px;
}

.modal-section-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section-count {
    background: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
}

.modal-stocks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.modal-stock-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.modal-stock-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-stock-card.gainer {
    border-left: 4px solid #4caf50;
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.05) 0%, white 100%);
}

.modal-stock-card.loser {
    border-left: 4px solid #f44336;
    background: linear-gradient(90deg, rgba(244, 67, 54, 0.05) 0%, white 100%);
}

.modal-stock-symbol {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    letter-spacing: 0.3px;
}

.modal-stock-change {
    font-size: 15px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
}

.modal-stock-card.gainer .modal-stock-change {
    color: #2e7d32;
    background: rgba(76, 175, 80, 0.15);
}

.modal-stock-card.loser .modal-stock-change {
    color: #c62828;
    background: rgba(244, 67, 54, 0.15);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 1200px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .market-sidebar {
        width: 100%;
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .market-sidebar {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-direction: column;
    }

    .modal-stocks-grid {
        grid-template-columns: 1fr;
    }

    .nifty-modal-content {
        width: 95%;
        max-height: 90vh;
    }
}

/* Tablet - sidebar in grid mode, adjust PCR for wider layout */
@media (min-width: 769px) and (max-width: 1200px) {
    .market-sidebar .pcr-metrics {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .market-sidebar .pcr-metric {
        flex-direction: column;
        text-align: center;
        padding: 10px 8px;
    }

    .market-sidebar .pcr-metric-label {
        margin-bottom: 6px;
    }
}

/* ============================================================================
   FOOTER SUMMARY
   ============================================================================ */
.footer-summary {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-size: 12px;
    color: #666;
}