/* ============================================================
   Footgolfazo - Custom Styles
   Tailwind handles the bulk of styling; this file covers
   brand variables, score-entry buttons, leaderboard, and
   other component-level overrides.
   ============================================================ */

/* ---------- Brand CSS Variables ---------- */
:root {
    --brand-50:  #f0fdf4;
    --brand-100: #dcfce7;
    --brand-200: #bbf7d0;
    --brand-300: #86efac;
    --brand-400: #4ade80;
    --brand-500: #22c55e;
    --brand-600: #16a34a;
    --brand-700: #15803d;
    --brand-800: #166534;
    --brand-900: #14532d;

    --color-primary:   var(--brand-600);
    --color-primary-dark: var(--brand-700);
    --color-bg:        #f9fafb;  /* gray-50 */
    --color-text:      #111827;  /* gray-900 */
    --color-muted:     #6b7280;  /* gray-500 */

    /* Scoring palette */
    --color-eagle:     #facc15;  /* yellow-400 */
    --color-birdie:    #22c55e;  /* green-500 */
    --color-par:       #9ca3af;  /* gray-400 */
    --color-bogey:     #f87171;  /* red-400 */
    --color-double:    #ef4444;  /* red-500 */
}

/* ---------- General ---------- */
body {
    color: var(--color-text);
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scroll for in-page anchors */
html {
    scroll-behavior: smooth;
}

/* ---------- Score Annotation Buttons ---------- */
/* Large touch targets for mobile score entry */
.score-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 56px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.score-btn:active {
    transform: scale(0.95);
}

.score-btn:focus-visible {
    outline: 3px solid var(--brand-400);
    outline-offset: 2px;
}

/* Score increment / decrement */
.score-btn--increment {
    background-color: var(--brand-100);
    color: var(--brand-800);
    border-color: var(--brand-300);
}

.score-btn--increment:hover {
    background-color: var(--brand-200);
}

.score-btn--decrement {
    background-color: #fee2e2; /* red-100 */
    color: #991b1b;           /* red-800 */
    border-color: #fca5a5;    /* red-300 */
}

.score-btn--decrement:hover {
    background-color: #fecaca; /* red-200 */
}

/* Score value display */
.score-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 56px;
    font-size: 1.75rem;
    font-weight: 800;
    border-radius: 12px;
    background-color: white;
    border: 2px solid #e5e7eb; /* gray-200 */
}

/* ---------- Score Result Labels ---------- */
.score-label--eagle {
    background-color: var(--color-eagle);
    color: #422006;
}

.score-label--birdie {
    background-color: var(--color-birdie);
    color: white;
}

.score-label--par {
    background-color: var(--color-par);
    color: white;
}

.score-label--bogey {
    background-color: var(--color-bogey);
    color: white;
}

.score-label--double {
    background-color: var(--color-double);
    color: white;
}

/* ---------- Leaderboard ---------- */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.leaderboard-table th {
    background-color: var(--brand-700);
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leaderboard-table th:first-child {
    border-radius: 8px 0 0 0;
}

.leaderboard-table th:last-child {
    border-radius: 0 8px 0 0;
}

.leaderboard-table td {
    padding: 10px 12px;
    font-size: 0.875rem;
    border-bottom: 1px solid #e5e7eb;
}

.leaderboard-table tbody tr:hover {
    background-color: var(--brand-50);
}

/* Position column styling */
.leaderboard-pos {
    font-weight: 800;
    font-size: 1rem;
    color: var(--brand-700);
    min-width: 32px;
    text-align: center;
}

.leaderboard-pos--1 {
    color: #ca8a04; /* yellow-600 / gold */
}

.leaderboard-pos--2 {
    color: #9ca3af; /* gray-400 / silver */
}

.leaderboard-pos--3 {
    color: #b45309; /* amber-700 / bronze */
}

/* Total score highlight */
.leaderboard-total {
    font-weight: 800;
    font-size: 1rem;
}

.leaderboard-total--under {
    color: var(--color-birdie);
}

.leaderboard-total--even {
    color: var(--color-muted);
}

.leaderboard-total--over {
    color: var(--color-bogey);
}

/* ---------- Live Pulse Animation ---------- */
.pulse-live {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulse-ring 1.5s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ---------- Utility: Fade-in animation ---------- */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
