/* GAMESTOPLAY.CSS
    Consolidated Styles for "Games to Play" 
    Includes: Theme variables, Grid Layout, Stats, Up Next Queue, and Randomizer
*/

/* 1. Variable Definitions for Light/Dark Mode Support */
:root {
    --omni-bg-page: #f4f7f9;
    --omni-bg-container: #ffffff;
    --omni-bg-section: #f8fafc;
    --omni-text: #1e293b;
    --omni-text-muted: #64748b;
    --omni-border: #e2e8f0;
    --omni-primary: #0ea5e9;
    --omni-accent: #059669; 
    --omni-priority: #e67e22; /* Orange for Up Next */
}

@media (prefers-color-scheme: dark) {
    :root {
        --omni-bg-page: #0f172a;
        --omni-bg-container: #1e293b;
        --omni-bg-section: #334155;
        --omni-text: #f1f5f9;
        --omni-text-muted: #94a3b8;
        --omni-border: #475569;
        --omni-primary: #38bdf8;
    }
}

/* 2. Container and Base Layout */
.gtp-content.ra-static-container {
    padding-top: 170px !important;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 40px;
    width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--omni-text);
}

.page-header {
    margin-bottom: 30px;
    border-bottom: 2px solid var(--omni-primary);
    padding-bottom: 10px;
}

.page-header h1 {
    margin: 0;
    color: var(--omni-text);
}

/* 2.5 Stats Section */
.stats-section {
    margin-bottom: 25px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.stat-card {
    background: var(--omni-bg-container);
    border: 1px solid var(--omni-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-card.total {
    border-left: 4px solid var(--omni-primary);
}

.stat-card.not-started {
    border-left: 4px solid #94a3b8;
}

.stat-card.in-progress {
    border-left: 4px solid #f59e0b;
}

.stat-card.finished {
    border-left: 4px solid var(--omni-accent);
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--omni-text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--omni-text);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-percentage {
    font-size: 14px;
    color: var(--omni-text-muted);
    font-weight: 500;
}

/* 3. Up Next (Priority Queue) Section */
.priority-queue-section {
    margin-bottom: 30px;
}

.priority-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.priority-card {
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--omni-border);
    background: var(--omni-bg-container);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80px;
    transition: transform 0.2s;
}

.priority-card.active {
    border-left: 5px solid var(--omni-priority);
    background: var(--omni-bg-section);
}

.priority-card.empty {
    background: var(--omni-bg-section);
    border: 1px dashed var(--omni-border);
    color: var(--omni-text-muted);
    text-align: center;
    font-size: 12px;
}

.p-card-title { font-weight: 700; color: var(--omni-text); font-size: 14px; }
.p-card-plat { font-size: 11px; color: var(--omni-text-muted); }
.p-remove-btn { 
    margin-top: 8px; font-size: 10px; color: #ef4444; border: none; background: none; 
    cursor: pointer; padding: 0; text-align: left; width: fit-content;
}

/* 4. Two-Column Grid Layout */
.omnira-grid-wrapper {
    display: flex;
    gap: 25px;
    width: 100%;
    align-items: flex-start;
}

.omnira-sidebar-column {
    flex: 0 0 300px; 
    background: var(--omni-bg-container);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--omni-border);
    position: sticky;
    top: 170px; 
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.omnira-table-column {
    flex: 1; 
    background: var(--omni-bg-container);
    border-radius: 8px;
    border: 1px solid var(--omni-border);
    overflow: hidden;
}

/* 5. Sidebar Controls & Randomizer Button */
.sidebar-label {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--omni-text-muted);
    margin-bottom: 12px;
}

.randomizer-btn {
    width: 100%;
    background-color: var(--omni-primary);
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.randomizer-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.gtp-search-bar {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--omni-border);
    border-radius: 5px;
    margin-bottom: 20px;
    background: var(--omni-bg-section);
    color: var(--omni-text);
}

.sidebar-divider {
    border: 0;
    border-top: 1px solid var(--omni-border);
    margin: 15px 0;
}

/* 6. Table Styling */
.static-dat-table {
    width: 100%;
    border-collapse: collapse;
}

.static-dat-table thead th {
    background: var(--omni-bg-section);
    padding: 15px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--omni-text-muted);
    border-bottom: 2px solid var(--omni-border);
}

.static-dat-table td {
    padding: 15px;
    border-bottom: 1px solid var(--omni-border);
    vertical-align: middle;
    color: var(--omni-text);
}

/* 7. Interactive Elements (Stars, Pins, Selects) */
.star-rating { color: #f1c40f; cursor: pointer; font-size: 14px; white-space: nowrap; }
.star-rating i { margin-right: 2px; }

.gtp-status-select {
    background: var(--omni-bg-section);
    border: 1px solid var(--omni-border);
    color: var(--omni-text);
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    width: 120px;
}

.priority-toggle-btn { background: none; border: none; color: var(--omni-border); cursor: pointer; font-size: 16px; transition: color 0.2s; }
.priority-toggle-btn.active { color: var(--omni-priority); }

.gtp-delete-btn { background: none; border: none; color: #dc3545; cursor: pointer; font-size: 18px; opacity: 0.7; }
.gtp-delete-btn:hover { opacity: 1; }

/* 8. Table Metadata Badges */
.gtp-game-title a { color: var(--omni-primary); font-weight: 600; text-decoration: none; font-size: 15px; }
.gtp-platform-sub { font-size: 11px; color: var(--omni-text-muted); display: block; }
.genre-tag { font-style: italic; color: var(--omni-text-muted); font-size: 12px; }
.region-badge { background: var(--omni-bg-section); padding: 2px 8px; border-radius: 4px; font-size: 12px; border: 1px solid var(--omni-border); }

.gtp-badge-stack { display: flex; flex-direction: column; gap: 4px; }
.gtp-badge { 
    background: var(--omni-bg-section); 
    color: var(--omni-text); 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-size: 10px; 
    border: 1px solid var(--omni-border);
    width: fit-content;
    text-transform: uppercase;
}
.gtp-badge-excl { border-color: var(--omni-priority); color: var(--omni-priority); }

/* 9. Animations & Row Hovers */
.gtp-row:hover td { background-color: #0000FF !important; color: #FFFFFF !important; }
body[data-theme='dark'] .gtp-row:hover td { background-color: #008000 !important; }

.gtp-row:hover a, 
.gtp-row:hover .gtp-delete-btn, 
.gtp-row:hover .gtp-platform-sub,
.gtp-row:hover .region-badge,
.gtp-row:hover .genre-tag,
.gtp-row:hover .gtp-status-select {
    color: #FFFFFF !important;
}

/* Flash animation while picking random game */
.random-highlight-flash {
    background-color: #059669 !important; /* Solid color during flash */
    color: white !important;
}

/* Winner highlight */
.random-highlight {
    outline: 3px solid var(--omni-accent); /* Green outline */
    outline-offset: -3px;
    background-color: rgba(5, 150, 105, 0.1) !important;
    animation: pulse-winner-green 2s infinite;
}

@keyframes pulse-winner-green {
    0% { background-color: rgba(5, 150, 105, 0.1); }
    50% { background-color: rgba(5, 150, 105, 0.3); }
    100% { background-color: rgba(5, 150, 105, 0.1); }
}

/* 10. Responsive Adjustments */
@media (max-width: 900px) {
    .omnira-grid-wrapper { flex-direction: column; }
    .omnira-sidebar-column { flex: 1 1 auto; width: 100%; position: relative; top: 0; max-height: none; }
    .priority-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
}
.gtp-tag-input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--omni-text-muted);
    font-size: 0.85em;
    width: 100%;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.gtp-tag-input:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.gtp-tag-input:focus {
    outline: none;
    border-color: #e67e22; /* Matches your "Up Next" color */
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
}