:root {
    --primary: #d35400;
    --bg: #ffcc99;
    --card-bg: #fff0e0;
    --text: #2c3e50;
    --text-muted: #7f8c8d;
    --accent: #e74c3c;
    --border: #e6b380;
    --header-bg: #ffe0b3;
    --header-text: #2c3e50;
    --footer-bg: #ffd699;
    --input-bg: #ffffff;
    --table-header: #ffd699;
}

/* Global Reset & Base */
html {
    min-height: 100%;
}

body {
    /* font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; */
    font-family: 'Times New Roman', Times, serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 1.1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 900;
}

.nav-link-home {
    color: var(--text);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.8rem;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    border: 1px solid var(--border);
}

label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
    font-weight: bold;
}

a {
    color: var(--primary);
    text-decoration: underline;
    transition: 0.3s;
}

a:hover {
    color: #e67e22;
    text-decoration: none;
}

/* Horizontal Link Hub */
.horizontal-link-hub {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    line-height: 2;
}

.hub-link {
    color: var(--text);
    text-decoration: underline;
    font-size: 0.85rem;
    margin: 0 5px;
    white-space: nowrap;
    display: inline-block;
}

.hub-sep {
    color: var(--border);
    margin: 0 2px;
}

/* Market Grids & Cards - Consistent Look */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    padding-bottom: 40px;
}

.sum-diff-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 30px;
    justify-content: center;
}

.sum-diff-pill-link {
    display: inline-block;
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.sum-diff-pill-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}


#market-list .market-card {
    padding: 15px !important;
}

.market-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.market-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.market-name {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.market-times {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 600;
}


.result-number {
    font-size: 32px;
    font-weight: 900;
    color: var(--primary);
    margin: 15px 0;
    letter-spacing: 3px;
}

.market-stats .market-times {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.market-stats .result-number {
    margin: 0;
    /* font-size: px; */
}

@media (max-width: 480px) {
    .result-number {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .market-name {
        font-size: 1.6rem;
    }

    #market-list .chart-btns {
        display: none !important;
    }

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

    .market-info .btn-jodi,
    .market-info .btn-panel {
        display: block !important;
    }

    .market-times {
        font-size: 0.9rem;
    }
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.status-open {
    background: #d4edda;
    color: #155724;
}

.status-declared {
    background: #cce5ff;
    color: #004085;
}

.status-closed {
    background: #f8d7da;
    color: #721c24;
}

.chart-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.market-info {
    /* flex-direction: column; */
    align-items: center;
    gap: 10px;
}

.market-info .market-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.market-info .btn-jodi,
.market-info .btn-panel {
    display: none;
}

.chart-btn {
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    transition: 0.2s;
}

.btn-jodi {
    background: var(--primary);
    color: #fff;
}

.btn-jodi:hover {
    background: #e67e22;
    color: #fff;
}

/* Analytics UI Styles - Refined for Layout & Alignment */
.analytics-control-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.control-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: flex-end;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

/* Ensure Search Input has its own dedicated space */
.search-row {
    margin-bottom: 20px;
}

.action-row {
    display: flex;
    justify-content: flex-end;
}

.btn-refresh-stats {
    width: 250px;
    /* Fixed width on laptop for consistency */
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

@media (max-width: 768px) {
    .analytics-control-panel {
        padding: 15px;
    }

    .control-row {
        gap: 15px;
    }

    .control-group {
        min-width: 100%;
    }

    .btn-refresh-stats {
        width: 100%;
    }
}

/* Analysis Results & Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.analysis-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.analysis-card h3 {
    color: var(--primary);
    font-size: 1.1rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.full-width {
    grid-column: 1 / -1;
}

/* Desktop Specifics */
@media (min-width: 992px) {
    .analysis-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .full-width {
        grid-column: span 3;
    }
}

@media (max-width: 768px) {
    .analytics-control-panel {
        padding: 10px;
    }

    .container {
        padding: 0 10px;
    }

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

/* Addition & Differance Sections - Grid Layout */
.addition-cards,
.differance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.addition-card,
.diff-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.addition-card:hover,
.diff-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.addition-card .market-name,
.diff-card .market-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.addition-card .market-value,
.diff-card .market-value {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 600;
}

.section-label {
    display: block;
    background: var(--primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1rem;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(211, 84, 0, 0.2);
}

.section-container {
    margin-bottom: 40px;
}

/* Common Components */
footer {
    text-align: center;
    padding: 30px;
    background: var(--footer-bg);
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

.seo-footer-sitemap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    padding: 40px 20px;
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    gap: 30px;
}

.sitemap-col {
    flex: 1;
    min-width: 200px;
}

.sitemap-col h4 {
    color: var(--primary);
    font-size: 1rem;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.sitemap-links {
    list-style: none;
    padding: 0;
}

.sitemap-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
}

.history-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.stats-table th {
    background: var(--table-header);
    text-align: left;
    padding: 12px 10px;
    border-bottom: 2px solid var(--border);
    font-size: 0.85rem;
    color: var(--text);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

/* Combo Report Specific Multi-row Headers */
.stats-table thead tr th {
    text-align: center;
    vertical-align: middle;
}

.stats-table thead tr:nth-child(2) th {
    background: #34495e !important;
    color: #fff !important;
    font-size: 0.6rem !important;
    padding: 6px 2px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    color: var(--text);
}

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.scroll-bottom-container {
    text-align: center;
    margin: 30px 0;
}

.scroll-nav-link {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
}

.telegram-join-btn {
    position: relative;
}

.new-badge {
    position: absolute;
    top: -10px;
    right: -8px;
    min-width: 38px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #ff2d55;
    color: #fff;
    border: 2px solid #fff;
    font-size: 0.62rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: 0 3px 8px rgba(255, 45, 85, 0.35);
    box-sizing: border-box;
}

.lazy-ad {
    max-width: 100%;
    contain: layout style;
}

.ad-placeholder {
    min-height: inherit;
    width: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, #f7f7f7 0%, #eeeeee 50%, #f7f7f7 100%);
    background-size: 200% 100%;
    animation: ad-placeholder-shimmer 1.8s ease-in-out infinite;
}

@keyframes ad-placeholder-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Calendar Matrix UI Styles */
.cell-markets {
    font-size: 0.6rem;
    line-height: 1.2;
    color: var(--text);
    font-weight: 600;
    white-space: pre-line;
    padding: 4px !important;
}

.calendar-hit {
    background-color: rgba(211, 84, 0, 0.1) !important;
}

.calendar-sunday {
    background-color: #fff176 !important;
    /* Distinct Yellow */
}

.red-jodi-name {
    color: #e74c3c !important;
}

.matrix-day-cell {
    width: 40px;
    font-weight: bold;
    background: #f8f9fa;
    text-align: center;
}

/* Gap Analysis Responsive UI */
.gap-analysis-card {
    margin-top: 30px;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.gap-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.gap-analysis-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

.gap-stat-box {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #fef9e7 0%, #fff9e6 100%);
    border-radius: 12px;
    border: 1px solid #f9e79f;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: fit-content;
}

@media (max-width: 768px) {
    .gap-analysis-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .gap-analysis-card {
        padding: 15px;
    }

    .gap-stat-box {
        padding: 20px 10px;
    }

    .gap-analysis-header h5 {
        font-size: 0.75rem !important;
    }
}
