/* =========================================
   Feature 11: Data Display Styles
   (Updated: Highlight Sync & Grid Alignment)
   ========================================= */

/* --- GRID LAYOUT --- */
.container {
    width: 100%;
    width: max-content;
    min-width: 850px;
    background: #1e293b;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: width 0.3s ease;
}

.container.hide-custom .col-custom,
.container.hide-custom .col-edge {
    display: none;
}

/* FIX: Use 1fr instead of 120px to match index.html styles */
.grid-row {
    display: grid;
    grid-template-columns: 40px minmax(200px, 2fr) 160px 1fr 1fr 1fr 1fr 1fr 1fr;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    height: 50px;
}

/* FIX: Use 1fr here too */
.container.hide-custom .grid-row {
    grid-template-columns: 40px minmax(200px, 2fr) 160px 1fr 1fr 1fr 1fr;
}

/* Headers */
.header-row {
    background: #1e293b;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    height: 45px;
    border-left: 2px solid transparent;
}

.grid-cell {
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 2px solid rgba(255, 255, 255, 0.03);
}

.grid-cell:last-child {
    border-right: none;
}

.col-header {
    justify-content: center;
    text-align: center;
}

/* Match Row & Highlighting */
.match-row {
    border-left: 2px solid transparent;
    transition: background 0.1s;
}

.match-row.row-highlight {
    background: rgba(255, 204, 0, 0.15) !important;
    border-left-color: #FFCC00;
}

/* Match Info */
.match-num {
    justify-content: center;
    color: #FFCC00;
    font-weight: 700;
    font-family: 'Segoe UI', sans-serif !important;
    font-size: 1rem;
}

.cell-left {
    justify-content: flex-start;
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
}

/* 1X2 Buttons */
.match-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    width: 100%;
}

.btn-outcome {
    width: 36px;
    height: 28px;
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 0 #cbd5e1;
    transition: all 0.1s;
}

.btn-outcome:hover {
    transform: translateY(-1px);
    background: #fff;
}

.btn-outcome:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn-outcome.selected {
    background: #00427A;
    color: white;
    border-color: #003366;
    box-shadow: 0 2px 0 #002244;
}

/* Data Cells */
.data-cell {
    justify-content: center;
    gap: 4px;
}

.val-box {
    width: 32px;
    text-align: center;
    padding: 3px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'Segoe UI', sans-serif;
    color: #fff;
}

.positive {
    color: #ef4444;
    font-weight: 700;
}

.negative {
    color: #4ade80;
    font-weight: 700;
}

.edge-good {
    color: #4ade80;
    font-weight: 700;
}

.edge-bad {
    color: #ef4444;
    opacity: 0.8;
}

@keyframes yellowPop {
    0% {
        background: #FFCC00;
        color: #000;
        transform: scale(1.2);
    }

    100% {
        background: rgba(255, 255, 255, 0.05);
        color: #fff;
        transform: scale(1);
    }
}

.wave-active div {
    animation: yellowPop 0.4s ease-out forwards;
}


/* --- ACTION DOCK (Box Style) --- */
.action-dock {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    width: 100%;

    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.dock-left,
.dock-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-button {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.action-button:hover {
    border-color: #FFCC00;
    color: #FFCC00;
    background: rgba(255, 255, 255, 0.05);
}

.action-button i {
    color: #94a3b8;
}

.action-button:hover i {
    color: #FFCC00;
}


/* --- FOOTER ACTION BUTTON --- */
.action-footer {
    display: grid;
    /* FIX: Match grid-row column definition exactly (1fr) */
    grid-template-columns: 40px minmax(200px, 2fr) 160px 1fr 1fr 1fr 1fr 1fr 1fr;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #1e293b;
    padding: 10px 0;
}

.container.hide-custom .action-footer {
    /* FIX: Match hidden state definition (1fr) */
    grid-template-columns: 40px minmax(200px, 2fr) 160px 1fr 1fr 1fr 1fr;
}

#fill-clear-btn {
    grid-column: 3;
    width: 100%;
    padding: 8px 0;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-family: inherit;
    outline: none;
    margin: 0 12px;
    width: calc(100% - 24px);
}

#fill-clear-btn:active {
    transform: scale(0.98);
}

#fill-clear-btn.fill-mode {
    background-color: #00427A;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 66, 122, 0.3);
}

#fill-clear-btn.fill-mode:hover {
    background-color: #00569e;
    border-color: #FFCC00;
}

#fill-clear-btn.clear-mode {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

#fill-clear-btn.clear-mode:hover {
    background-color: #ef4444;
    color: white;
    border-color: #ef4444;
}