/* Core Colors & Custom Variables */
:root {
    --bg-dark: #070d0b;
    --bg-card: #0e1b17;
    --bg-card-hover: #13241f;
    --border-color: rgba(82, 183, 136, 0.15);
    --border-color-hover: rgba(82, 183, 136, 0.3);
    
    --primary: #40916c;
    --primary-light: #52b788;
    --primary-dark: #2d6a4f;
    --accent: #74c69d;
    --accent-gold: #d4af37;
    --text-main: #f8f9fa;
    --text-muted: #95d5b2;
    --text-dark: #1b4332;
    --danger: #e63946;
    --danger-bg: rgba(230, 57, 70, 0.1);
    
    --font-primary: 'Plus Jakarta Sans', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-primary);
    min-height: 100vh;
    overflow-x: auto;
    overflow-y: scroll;
}

/* FullHD Fixed Container Constraint */
.app-container {
    width: 1880px;
    min-width: 1880px;
    max-width: 1880px;
    margin: 0 auto;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header Section */
.app-header {
    background: linear-gradient(135deg, var(--bg-card) 0%, #152d26 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-badge {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    color: var(--bg-dark);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 28px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(82, 183, 136, 0.4);
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-main);
    line-height: 1.2;
}

.logo-text p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(82, 183, 136, 0.08);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(82, 183, 136, 0.2);
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.indicator-dot.online {
    background-color: var(--primary-light);
    box-shadow: 0 0 8px var(--primary-light);
}

/* Dashboard Grid Layout with Google Adsense columns */
.dashboard-grid {
    display: grid;
    grid-template-columns: 240px 1fr 1fr 240px;
    gap: 24px;
}

.adsense-placeholder {
    background: transparent;
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    height: 100%;
}

.left-ad {
    grid-column: 1;
}

.panel-a {
    grid-column: 2;
    padding: 20px !important;
}

.panel-b {
    grid-column: 3;
    padding: 20px !important;
}

.right-ad {
    grid-column: 4;
}

.middle-ad {
    grid-column: 1 / span 4;
    width: 970px;
    height: 90px;
    min-height: 90px !important;
    margin: 8px auto;
}

.panel-c, .panel-d, .panel-e {
    grid-column: 1 / span 4;
}

/* Panel A & B Compact Mode */
.panel-a .status-stats {
    gap: 12px;
    margin-bottom: 16px;
}
.panel-a .stat-box {
    padding: 10px;
    border-radius: 8px;
    gap: 4px;
}
.panel-a .stat-value {
    font-size: 22px;
}
.panel-a .sync-actions {
    margin-bottom: 12px;
}
.panel-a .card-header, .panel-b .card-header {
    margin-bottom: 16px;
    padding-bottom: 10px;
    justify-content: space-between;
}
.panel-b .form-group {
    margin-bottom: 12px;
    gap: 4px;
}
.panel-b .form-group input {
    padding: 8px 12px;
}
.panel-b .form-group label {
    font-size: 12px;
}
.panel-b button {
    padding: 10px 16px;
    font-size: 14px;
}
.panel-a button {
    padding: 10px 16px;
    font-size: 14px;
}

/* Card Styling */
.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.dashboard-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

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

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
}

/* Panel A Specific Styles */
.status-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: rgba(82, 183, 136, 0.04);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 700;
    color: var(--primary-light);
}

.stat-sub {
    font-size: 11px;
    color: rgba(248, 249, 250, 0.6);
}

.sync-actions {
    margin-bottom: 20px;
}

/* Progress bar container styling */
.sync-progress {
    background: rgba(14, 27, 23, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.progress-bar-wrapper {
    background: rgba(255, 255, 255, 0.05);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    height: 100%;
    border-radius: 5px;
    width: 0%;
    transition: width 0.4s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

/* Buttons */
.btn-primary, .btn-success {
    width: 100%;
    padding: 14px 20px;
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary, .btn-success {
    background-color: var(--primary);
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(64, 145, 108, 0.3);
}

.btn-primary:hover:not(:disabled), .btn-success:hover:not(:disabled) {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(82, 183, 136, 0.4);
}

.btn-primary:disabled, .btn-success:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-primary);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(82, 183, 136, 0.2);
}

.field-hint {
    font-size: 11px;
    color: rgba(248, 249, 250, 0.5);
}

.error-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    color: #ff9f9f;
    font-size: 13px;
}

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

/* Results Section styling */
.panel-c {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.range-subtitle {
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    margin-top: 4px;
}

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

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 100px 0;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 64px;
    opacity: 0.6;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-main);
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    text-align: center;
    opacity: 0.8;
}

/* Statistics Content Rows */
.stats-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.subpanels-row {
    display: flex;
    gap: 24px;
}

.flex-1 {
    flex: 1;
}

.subpanel {
    background: rgba(82, 183, 136, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.subpanel-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(82, 183, 136, 0.1);
    padding-bottom: 8px;
}

/* Tables styling */
.table-container {
    max-height: 300px;
    overflow-y: auto;
    max-width: 480px;
    margin: 0 auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: none;
}

.data-table td {
    padding: 4px 16px;
    font-size: 14px;
    border-bottom: none;
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: rgba(14, 27, 23, 0.5);
    position: sticky;
    top: 0;
}

.data-table tbody tr:nth-child(odd) {
    background-color: rgba(82, 183, 136, 0.025);
}
.data-table tbody tr:nth-child(even) {
    background-color: rgba(82, 183, 136, 0.06);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

/* Horizontal Table style */
.margin-top {
    margin-top: 8px;
}

.horizontal-table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 420px;
    width: 100%;
    max-width: 1620px;
    margin: 0 auto;
}

.horizontal-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.horizontal-table tr {
    border-bottom: none;
}

.horizontal-table tr:nth-child(odd) {
    background-color: rgba(82, 183, 136, 0.025);
}
.horizontal-table tr:nth-child(even) {
    background-color: rgba(82, 183, 136, 0.06);
}

.horizontal-table tr:last-child {
    border-bottom: none;
}

.horizontal-table td, .horizontal-table th {
    padding: 8px 10px;
    font-size: 14px;
    border-right: none;
    white-space: nowrap;
}

.horizontal-table td:last-child, .horizontal-table th:last-child {
    border-right: none;
}

/* Custom row descriptors */
.row-header-title {
    font-weight: 700;
    color: var(--accent);
    text-align: left !important;
    background-color: rgba(14, 27, 23, 0.6);
    padding-left: 20px !important;
    min-width: 220px;
    font-size: 13px !important;
    text-transform: uppercase;
}

.ten-header-cell {
    background-color: var(--primary-dark);
    color: var(--text-main);
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 15px !important;
    width: 55px;
}

.stat-cell-value {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 500;
}

.stat-cell-value.highlight {
    color: var(--accent);
    font-weight: 500;
}

.stat-cell-value.empty-dash {
    color: rgba(248, 249, 250, 0.25);
}

/* Highlighting Max & Min Values */
.highlight-max-row {
    color: var(--accent-gold) !important;
    font-weight: 700;
    background-color: rgba(212, 175, 55, 0.12) !important;
}

.highlight-max-red {
    color: #ff4a5a !important;
    font-weight: 800 !important;
}

.highlight-min-yellow {
    color: #ffdd53 !important;
    font-weight: 800 !important;
}
/* Card Generator Layout Rules */
.panel-d {
    grid-column: 1 / span 4;
}

#panel-generator .horizontal-table-container {
    overflow-y: visible;
}

#generator-table td, #generator-table th {
    padding: 6px 10px !important;
}

.generator-form-row {
    display: flex;
    gap: 30px;
    align-items: flex-end;
    background: rgba(82, 183, 136, 0.02);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.input-range-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-range-row input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-primary);
    font-size: 14px;
    width: 120px;
    transition: var(--transition);
}

.input-range-row input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.08);
}

.input-range-row span {
    color: var(--text-muted);
    font-size: 14px;
}

.button-container-gen {
    min-width: 180px;
}

.generator-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.results-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(82, 183, 136, 0.05);
    padding: 12px 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-light);
}

.total-cards-label {
    font-size: 15px;
    color: var(--text-main);
}

.total-cards-label strong {
    color: var(--primary-light);
    font-size: 18px;
    font-family: var(--font-heading);
}

.limit-cards-label {
    font-size: 12px;
    color: var(--accent-gold);
    font-weight: 600;
}

/* Simulation Results Styles */
.simulation-trigger-row {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.simulation-results-box {
    background: rgba(82, 183, 136, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-top: 16px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

.sim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(82, 183, 136, 0.1);
    padding-bottom: 12px;
    margin-bottom: 18px;
}

.sim-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--accent);
    font-weight: 600;
}

.sim-contest-info {
    font-size: 14px;
    color: var(--text-main);
}

.sim-contest-info strong {
    color: var(--primary-light);
}

.sim-drawn-tens {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    background: rgba(14, 27, 23, 0.4);
    padding: 12px 20px;
    border-radius: 8px;
}

.drawn-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

.drawn-balls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.drawn-ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-heading);
    border: 1px solid var(--accent);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.sim-score-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.score-card {
    background: rgba(82, 183, 136, 0.05);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.score-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.score-value {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--accent-gold);
}

/* Helpers */
.hidden {
    display: none !important;
}

/* Footer Section */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
    color: rgba(248, 249, 250, 0.4);
    font-size: 12px;
}
