/* ???????????????????????????????????????????????????????????????????????????
   FootGolf Score ? Main Stylesheet
   ??????????????????????????????????????????????????????????????????????????? */

:root {
    --fg-green:      #1a7a3c;
    --fg-green-dark: #135c2d;
    --fg-green-light:#25a552;
    --fg-orange:     #f57c00;
    --fg-orange-light:#ff9800;
    --fg-gray:       #f5f6fa;
    --fg-border:     #e2e8f0;
    --fg-text:       #2d3748;
    --fg-muted:      #718096;

    /* Score colours */
    --hio-bg:    #8b5cf6;
    --eagle-bg:  #f59e0b;
    --birdie-bg: #ef4444;
    --par-bg:    #6b7280;
    --bogey-bg:  #3b82f6;
    --double-bg: #93c5fd;
    --over-bg:   #dbeafe;
}

/* ?? Base ???????????????????????????????????????????????????????????????????? */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--fg-gray);
    color: var(--fg-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--fg-green); text-decoration: none; }
a:hover { color: var(--fg-green-dark); text-decoration: underline; }

/* ?? Navbar ?????????????????????????????????????????????????????????????????? */
.navbar {
    background: linear-gradient(135deg, var(--fg-green-dark) 0%, var(--fg-green) 100%);
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    padding: 0.75rem 0;
}

.navbar-brand { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; }
.brand-icon   { font-size: 1.6rem; margin-right: 6px; }
.brand-text   { color: #fff; }

.nav-link { color: rgba(255,255,255,.85) !important; font-weight: 500; padding: 0.4rem 0.9rem !important; border-radius: 6px; transition: all .2s; }
.nav-link:hover, .nav-link.active { color: #fff !important; background: rgba(255,255,255,.15); }

/* ?? Hero / Banner ??????????????????????????????????????????????????????????? */
.hero {
    background: linear-gradient(135deg, var(--fg-green-dark) 0%, var(--fg-green) 60%, var(--fg-green-light) 100%);
    color: #fff;
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '?';
    position: absolute;
    font-size: 20rem;
    opacity: .05;
    right: -60px;
    top: -60px;
    line-height: 1;
}

.hero h1  { font-size: 2.8rem; font-weight: 800; }
.hero .lead { opacity: .9; font-size: 1.1rem; }

/* ?? Section titles ?????????????????????????????????????????????????????????? */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fg-green-dark);
    border-left: 4px solid var(--fg-orange);
    padding-left: 12px;
    margin-bottom: 1.5rem;
}

/* ?? Cards ??????????????????????????????????????????????????????????????????? */
.card {
    border: 1px solid var(--fg-border);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: transform .2s, box-shadow .2s;
    background: #fff;
}

.card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }

.card-header {
    background: linear-gradient(135deg, var(--fg-green-dark), var(--fg-green));
    color: #fff;
    border-radius: 11px 11px 0 0 !important;
    font-weight: 600;
    padding: 0.85rem 1.25rem;
    border: none;
}

.card-header .badge { font-size: .7rem; }

/* ?? Stat boxes ?????????????????????????????????????????????????????????????? */
.stat-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--fg-border);
    padding: 1.5rem;
    text-align: center;
    transition: all .2s;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.stat-card .stat-number { font-size: 2.5rem; font-weight: 800; color: var(--fg-green); line-height: 1; }
.stat-card .stat-label  { font-size: .85rem; color: var(--fg-muted); margin-top: 4px; }
.stat-card .stat-icon   { font-size: 2rem; color: var(--fg-orange); margin-bottom: .5rem; }

/* ?? Tables ?????????????????????????????????????????????????????????????????? */
.table-fg {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border: 1px solid var(--fg-border);
}

.table-fg thead tr { background: var(--fg-green-dark); color: #fff; }
.table-fg thead th { font-weight: 600; padding: .85rem 1rem; border: none; font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; }
.table-fg tbody td { padding: .8rem 1rem; border-color: var(--fg-border); vertical-align: middle; }
.table-fg tbody tr:hover { background: #f0fdf4; }

.rank-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    font-weight: 700; font-size: .85rem;
}
.rank-1 { background: #ffd700; color: #7a5800; }
.rank-2 { background: #c0c0c0; color: #444; }
.rank-3 { background: #cd7f32; color: #fff; }
.rank-n { background: var(--fg-gray); color: var(--fg-muted); }

/* ?? Score cells (scorecard) ????????????????????????????????????????????????? */
.score-cell {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; font-weight: 700; font-size: .9rem; color: #fff;
}

.score-hio    { background: var(--hio-bg); box-shadow: 0 0 0 3px #c4b5fd; }
.score-eagle  { background: var(--eagle-bg); }
.score-birdie { background: var(--birdie-bg); border-radius: 50%; }
.score-par    { background: transparent; color: var(--fg-text); border: 2px solid var(--fg-border); }
.score-bogey  { background: var(--bogey-bg); }
.score-double { background: var(--double-bg); color: #1e40af; }
.score-over   { background: var(--over-bg); color: #1e40af; }

/* ?? Scorecard table ????????????????????????????????????????????????????????? */
.scorecard-table { font-size: .85rem; }
.scorecard-table th { background: var(--fg-green-dark); color: #fff; font-size: .75rem; text-align: center; padding: .5rem .4rem; }
.scorecard-table td { text-align: center; padding: .45rem .4rem; border-color: var(--fg-border); }
.scorecard-table .row-par { background: #f0fdf4; font-weight: 600; }
.scorecard-table .row-total { background: var(--fg-green); color: #fff; font-weight: 700; }
.scorecard-table .col-in { background: #fff9f0; }
.scorecard-table .col-out { background: #f8faff; }

/* ?? Tournament status pills ????????????????????????????????????????????????? */
.badge.bg-info     { background: #0dcaf0 !important; }
.badge.bg-success  { background: var(--fg-green-light) !important; }

/* ?? Player avatar ??????????????????????????????????????????????????????????? */
.player-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--fg-green), var(--fg-green-light));
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem; font-weight: 700;
}

.player-avatar-lg {
    width: 80px; height: 80px; font-size: 2rem;
}

/* ?? Page header ????????????????????????????????????????????????????????????? */
.page-header {
    background: linear-gradient(135deg, var(--fg-green-dark), var(--fg-green));
    color: #fff;
    padding: 2rem 0 1.5rem;
    margin-bottom: 2rem;
}

.page-header h1 { font-size: 2rem; font-weight: 700; margin: 0; }
.page-header .breadcrumb { margin: 0; padding: 0; background: transparent; }
.page-header .breadcrumb-item { color: rgba(255,255,255,.7); }
.page-header .breadcrumb-item.active { color: #fff; }
.page-header .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.5); }

/* ?? Buttons ????????????????????????????????????????????????????????????????? */
.btn-fg {
    background: linear-gradient(135deg, var(--fg-green), var(--fg-green-light));
    color: #fff; border: none; border-radius: 8px;
    font-weight: 600; padding: .5rem 1.25rem;
    transition: all .2s;
}
.btn-fg:hover { background: linear-gradient(135deg, var(--fg-green-dark), var(--fg-green)); color: #fff; transform: translateY(-1px); }

.btn-fg-outline {
    border: 2px solid var(--fg-green); color: var(--fg-green);
    border-radius: 8px; font-weight: 600; padding: .5rem 1.25rem;
    background: transparent; transition: all .2s;
}
.btn-fg-outline:hover { background: var(--fg-green); color: #fff; }

/* ?? Footer ?????????????????????????????????????????????????????????????????? */
.site-footer {
    background: var(--fg-green-dark);
    color: rgba(255,255,255,.85);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-brand { font-size: 1.3rem; font-weight: 700; color: #fff; }
.footer-heading { color: #fff; font-weight: 600; font-size: .9rem; text-transform: uppercase; letter-spacing: .5px; margin-bottom: .75rem; }
.footer-links li { margin-bottom: .35rem; }
.footer-links a { color: rgba(255,255,255,.7); font-size: .9rem; transition: color .2s; }
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer-divider { border-color: rgba(255,255,255,.15); margin: 1.5rem 0 1rem; }

/* ?? Torneio detail ?????????????????????????????????????????????????????????? */
.torneiro-info-box {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--fg-border);
    padding: 1.5rem;
}

.info-row { display: flex; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--fg-border); }
.info-row:last-child { border-bottom: none; }
.info-icon { width: 36px; height: 36px; background: var(--fg-gray); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--fg-green); margin-right: .85rem; font-size: .95rem; flex-shrink: 0; }
.info-label { font-size: .78rem; color: var(--fg-muted); }
.info-value { font-weight: 600; font-size: .95rem; }

/* ?? Responsive tweaks ??????????????????????????????????????????????????????? */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .stat-card .stat-number { font-size: 1.8rem; }
    .scorecard-table { font-size: .75rem; }
    .scorecard-table .col-label { display: none; }
}

/* ?? Alerts ?????????????????????????????????????????????????????????????????? */
.alert { border-radius: 10px; border: none; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger  { background: #fee2e2; color: #991b1b; }
.alert-info    { background: #e0f2fe; color: #0c4a6e; }
