/* IRON GUARD ENGINE GLOBAL STYLES */

:root {
    --bg-dark: #0b0e14;
    --panel-dark: rgba(21, 27, 35, 0.75);
    --border-dim: rgba(255, 255, 255, 0.08);
    --neon-blue: #00f0ff;
    --neon-blue-glow: rgba(0, 240, 255, 0.2);
    --neon-orange: #ff6b00;
    --text-primary: #f0f4f8;
    --text-secondary: #8b9eb3;
    --text-accent: #b0c4de;
    --font-headers: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    background-image: radial-gradient(circle at top right, rgba(0, 240, 255, 0.03), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(255, 107, 0, 0.03), transparent 40%);
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

.glass-panel {
    background: var(--panel-dark);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.main-table-panel {
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.25), inset 0 0 20px rgba(0, 240, 255, 0.08);
}

.chat-glass-panel {
    background: #e6e6e6 !important; /* Forces light gray over the default glass panel dark background */
    border: 3px solid #000000 !important; /* Thick black border */
    box-shadow: none !important; /* Removes orange glow */
}

/* MAIN CONTENT */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow: hidden;
    flex: 1.5;
    min-height: 0;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Compress bottom alignment */
    border: 2px solid #ffffff;
    background: linear-gradient(135deg, rgba(140, 230, 240, 0.95) 0%, rgba(100, 200, 210, 0.9) 100%); /* Lighter Teal */
    box-shadow: 0 0 60px rgba(0, 240, 255, 0.55), inset 0 0 35px rgba(0, 240, 255, 0.25);
    backdrop-filter: blur(10px);
    padding: 0.2rem 1.5rem !important; /* High compression padding */
}

.top-bar .brand-main,
.top-bar .brand-sub,
.top-bar .sub-header,
.top-bar .sub-header-weight,
.top-bar .highlight-text {
    color: #050505;
    text-shadow: none;
}

.top-bar .metric-card .value {
    color: #000000;
}

.top-bar .metric-card .label {
    color: #333333;
    font-weight: 700;
}

.top-bar .action-btn {
    color: #000000;
    border: 2px solid #000000;
}

.top-bar .action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    box-shadow: none;
}

.header-titles {
    display: flex;
    flex-direction: column;
}

.top-bar h2 {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.brand-main {
    font-family: var(--font-headers);
    font-size: 4.375rem; /* Increased 25% from 3.5rem */
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    line-height: 0.8;
}

.brand-sub {
    font-family: var(--font-headers);
    font-size: 1rem; /* Reduced by 50% from 2rem */
    font-weight: 500;
    color: var(--text-secondary);
}

.sub-header {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-family: var(--font-body);
}

.sub-header-weight {
    font-weight: 600;
    color: var(--text-accent);
    letter-spacing: 0.5px;
}

.highlight-text {
    color: var(--text-primary);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: flex-end;
    gap: 2rem;
}

.metrics-summary {
    display: flex;
    gap: 2rem;
    padding-right: 2rem;
    border-right: 1px solid var(--border-dim);
}

.metric-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.metric-card .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-align: right;
    line-height: 1.2;
}

.metric-card .value {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: #ff0000; /* Max divergence and Matchup count to red font */
}

.highlight-blue {
    color: var(--neon-blue);
}

.action-btn {
    font-family: var(--font-headers);
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.action-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.black-gray {
    background: #b3b3b3; /* Light/mid gray as per user mockup */
    color: #000000;
    border: 3px solid #000000;
}

.black-gray:hover {
    background: #d9d9d9;
}

.fetch-timestamp {
    color: #ff0000;
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 0.4rem;
    text-align: right;
    font-family: var(--font-mono);
}

.neon-blue {
    background: transparent;
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
}

.neon-blue:hover {
    background: var(--neon-blue-glow);
    box-shadow: 0 0 15px var(--neon-blue-glow);
}

.neon-orange {
    background: transparent;
    color: var(--neon-orange);
    border: 1px solid var(--neon-orange);
}

.neon-orange:hover {
    background: rgba(255, 107, 0, 0.15);
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.2);
}

/* TABLE GRID */
.grid-container {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.table-wrapper {
    overflow-y: auto;
    width: 100%;
    height: 100%;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark); 
}
::-webkit-scrollbar-thumb {
    background: #ffffff; 
    border-radius: 7px;
    border: 3px solid var(--bg-dark); /* creates spacing around the thumb */
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary); 
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
}

/* We hide the global thead in html, these styles are partially reused for the injected odds headers */
thead th {
    background: rgba(11, 14, 20, 0.95);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: var(--font-headers);
    letter-spacing: 1px;
    padding: 0.8rem 1rem;
    text-align: left;
    margin-bottom: 2rem;
}

.odds-header-row td {
    background: #ffffff;
    color: #000000;
    border-top: 2px solid #000000;
    border-bottom: 2px solid #000000;
    font-size: 0.75rem;
    font-family: var(--font-headers);
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.7rem 0.65rem;
    text-align: left;
    white-space: nowrap;
}

tbody td {
    padding: 0.65rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    white-space: nowrap;
}

.tm-font {
    color: var(--neon-blue);
    font-family: var(--font-headers);
    font-weight: 600;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.loading-cell {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 3rem !important;
}

/* MATCHUP SEPARATOR */
.matchup-header-row td {
    background: linear-gradient(135deg, rgba(180, 240, 255, 0.95) 0%, rgba(130, 220, 255, 0.9) 100%);
    border-top: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.2);
    padding: 0.8rem 1rem;
}

.matchup-header-row .team-name {
    color: #050505;
    text-shadow: none;
}

.matchup-header-row .team-tag {
    color: #333333;
    font-weight: 700;
}

.matchup-header-row .matchup-separator {
    color: #000000;
    font-weight: 800;
}

.matchup-banner {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

.team-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.team-tag {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 0.3rem;
}

.matchup-separator {
    color: var(--neon-blue);
    font-weight: 900;
    margin: 0 0.5rem;
}

/* INJECTED ODDS HEADER */
.odds-header-row {
    background: #ffffff;
}

.odds-header-row td {
    color: #000000;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-family: var(--font-headers);
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    border-top: 2px solid #000000;
    border-bottom: 2px solid #000000;
}

/* CHAT PANEL */
.chat-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 350px;
}

.chat-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: 0.2rem;
    margin-bottom: 0.2rem;
}

.chat-header h3 {
    font-family: var(--font-headers);
    color: #000000;
    font-size: 2.25rem; /* Increased 50% from original 1.5rem */
    letter-spacing: 1px;
    margin: 0;
    line-height: 1;
}

.badge.orange {
    background: transparent;
    color: #000000; /* Inverting white badge to black, otherwise illegible on light gray */
    border: 2px solid #000000; /* Matching inversion */
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-family: var(--font-mono);
}

.badge.black-pill {
    background: transparent;
    color: #000000;
    border: 1px solid #000000;
    font-size: 0.9rem; /* Increased 50% from 0.6rem */
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-family: var(--font-mono);
}

.chat-history {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: 0; /* Crucial to enforce flex scrolling */
    padding: 0.5rem 0.2rem; /* Shrunk padding to expand text space */
}

/* Custom black scrollbar for the Chat Panel */
.chat-history::-webkit-scrollbar {
    width: 8px;
}
.chat-history::-webkit-scrollbar-track {
    background: transparent;
}
.chat-history::-webkit-scrollbar-thumb {
    background: #000000;
    border-radius: 4px;
}

.message {
    font-size: 0.85rem;
    line-height: 1.3;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.05); /* Black overlay instead of white */
    color: #000000;
}

.message.system {
    border-left: 3px solid #000000;
}

.message.user {
    background: rgba(0, 0, 0, 0.1);
    align-self: flex-end;
}

.message.ige {
    border-left: 3px solid var(--neon-orange);
}

.sender {
    font-family: var(--font-headers);
    font-weight: 700;
    margin-bottom: 0.3rem;
    font-size: 0.75rem;
    color: #000000;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
}

#chatInput {
    flex-grow: 1;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 4px;
    padding: 0.6rem;
    color: #000000;
    font-family: var(--font-body);
}

#chatInput:focus {
    outline: none;
    border-color: var(--text-secondary);
}

/* MOBILE RESPONSIVE MEDIA QUERIES */
@media (max-width: 1100px) {
    body {
        height: auto;
        overflow-y: auto;
    }

    .dashboard-container {
        height: auto;
        padding: 1rem;
    }

    .main-content {
        overflow: visible;
        flex: none;
    }

    .table-wrapper {
        height: auto;
        overflow-x: auto;
    }

    .chat-panel {
        height: 600px;
        flex: none;
    }

    .top-bar {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1rem !important;
    }

    .header-actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 1rem;
        margin-top: 1rem;
    }

    .metrics-summary {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-dim);
        padding-bottom: 1rem;
        justify-content: center;
        width: 100%;
    }
    
    .brand-main {
        font-size: 3rem;
    }
}

