﻿/* ======================
   Light-Mode (Default)
   ====================== */

.scores-table th,
.scores-table td {
    padding: 0.75rem;
    vertical-align: middle;
    border: 1px solid #dee2e6;
}

.scores-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.scores-table tbody tr:first-child {
    background-color: #fff;
}

.scores-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.scores-table td {
    vertical-align: middle;
    text-align: center;
}

.scores-table td:first-child {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

/* Score Circles */
.birdie-1,
.birdie-2,
.birdie-3,
.bogey-1,
.bogey-2,
.bogey-3,
.par-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.par-score {
    background-color: #fff;
    border: 1px solid #dee2e6;
}

.birdie-1 {
    background-color: #d4edda;
    color: #155724;
}

.birdie-2 {
    background-color: #9be6b0;
    color: #155724;
}

.birdie-3 {
    background-color: #28a745;
    color: #fff;
}

.bogey-1 {
    background-color: #f8d7da;
    color: #721c24;
}

.bogey-2 {
    background-color: #f5c6cb;
    color: #721c24;
}

.bogey-3 {
    background-color: #dc3545;
    color: #fff;
}

/* Footer row */
.scores-table tfoot tr {
    background-color: #f8f9fa;
    font-weight: 600;
}

.scores-table tfoot td {
    border-top: 2px solid #dee2e6;
}

/* Utility text colors */
.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Responsiveness */
@media (max-width: 768px) {
    .scores-table {
        font-size: 0.85rem;
    }

    .scores-table th,
    .scores-table td {
        padding: 0.5rem;
    }

    .birdie-1, .birdie-2, .birdie-3,
    .bogey-1, .bogey-2, .bogey-3 {
        width: 24px;
        height: 24px;
    }
}

/* Ratings (light mode) */
.rating-great {
    background-color: #4CAF50;
    color: #fff;
}

.rating-better {
    background-color: #8BC34A;
    color: #fff;
}

.rating-good {
    background-color: #CDDC39;
    color: #000;
}

.rating-neutral {
    background-color: #F5F5F5;
    color: #000;
    border: 1px solid #E0E0E0;
}

.rating-below {
    background-color: #FFCC80;
    color: #000;
}

.rating-worse {
    background-color: #FF9800;
    color: #fff;
}

.rating-poor {
    background-color: #F44336;
    color: #fff;
}


/* ======================
   Dark Mode Overrides
   ====================== */
[data-bs-theme="dark"] {
    /* Table Borders and Cells */

    .scores-table th,
    .scores-table td {
        border-color: rgba(255, 255, 255, 0.1);
    }

    /* Table Header */

    .scores-table thead th {
        background-color: #334155; /* dark slate */
        color: #e2e8f0; /* light text */
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    /* First row in TBODY */

    .scores-table tbody tr:first-child {
        background-color: #1e293b; /* a bit darker */
    }

    /* Even rows */

    .scores-table tbody tr:nth-child(even) {
        background-color: #1e293b;
    }

    /* Leftmost cell (hole # or player name?) */

    .scores-table td:first-child {
        background-color: #334155;
        color: #e2e8f0;
    }

    /* Footer row */

    .scores-table tfoot tr {
        background-color: #334155;
    }

    .scores-table tfoot td {
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    /* Par score circle */

    .par-score {
        background-color: #475569;
        border-color: rgba(255, 255, 255, 0.1);
    }

    /* Birdies (Darker Greens) */

    .birdie-1 {
        background-color: #14532d; /* deep green */
        color: #86efac; /* bright mint text */
    }

    .birdie-2 {
        background-color: #15803d;
        color: #ffffff;
    }

    .birdie-3 {
        background-color: #16a34a;
        color: #ffffff;
    }

    /* Bogeys (Darker Reds) */

    .bogey-1 {
        background-color: #7f1d1d;
        color: #fecaca;
    }

    .bogey-2 {
        background-color: #991b1b;
        color: #fecaca;
    }

    .bogey-3 {
        background-color: #dc2626;
        color: #ffffff;
    }

    /* Utility text colors */

    .text-success {
        color: #10b981 !important; /* tailwind green */
    }

    .text-danger {
        color: #ef4444 !important; /* tailwind red */
    }

    /* Ratings (Dark Mode) */

    .rating-great {
        background-color: #065f46;
        color: #ffffff;
    }

    .rating-better {
        background-color: #047857;
        color: #ffffff;
    }

    .rating-good {
        background-color: #0284c7;
        color: #ffffff;
    }

    .rating-neutral {
        background-color: #475569;
        color: #f1f5f9;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .rating-below {
        background-color: #78350f;
        color: #ffe8d3;
    }

    .rating-worse {
        background-color: #92400e;
        color: #ffffff;
    }

    .rating-poor {
        background-color: #b91c1c;
        color: #ffffff;
    }
}

/* Powered by PDGA Footer */
.powered-by-pdga {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.powered-by-pdga:hover {
    opacity: 1;
}

.powered-by-pdga span {
    font-size: 0.875rem;
    color: #6c757d;
}

.powered-by-pdga .pdga-logo,
.powered-by-pdga img {
    height: 20px;
    width: auto;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.powered-by-pdga:hover .pdga-logo,
.powered-by-pdga:hover img {
    filter: grayscale(0%);
}

/* Dark mode overrides for powered by PDGA */
[data-bs-theme="dark"] {
    .powered-by-pdga {
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    .powered-by-pdga span {
        color: #94a3b8;
    }

    .powered-by-pdga .pdga-logo,
    .powered-by-pdga img {
        filter: grayscale(100%) brightness(0.8);
    }

    .powered-by-pdga:hover .pdga-logo,
    .powered-by-pdga:hover img {
        filter: grayscale(0%) brightness(1);
    }
}
