/* ============================================================
   CardieGolf Theme — Premium Golf Identity
   ============================================================ */

/* --- Custom Properties --- */
:root {
    --cg-green-dark: #1B6B3A;
    --cg-green: #1B6B3A;
    --cg-green-light: #1B6B3A;
    --cg-green-pale: #e3f0f5;
    --cg-blue: #3B82A0;
    --cg-blue-light: #5A9CB8;
    --cg-blue-pale: #e3f0f5;
    --cg-white: #FFFFFF;
    --cg-gray-dark: #4A4E50;
    --cg-gray-light: #f0ebd3;
    --cg-text: #4A4E50;
    --cg-text-muted: #6e7476;
    --cg-border: #d5d9da;
    --cg-shadow: 0 2px 12px rgba(27, 107, 58, 0.08);
    --cg-shadow-hover: 0 6px 20px rgba(27, 107, 58, 0.14);
    --cg-radius: 12px;
    --cg-radius-sm: 8px;
    --cg-transition: all 0.2s ease;
    /* Legacy aliases */
    --cg-gold: var(--cg-blue);
    --cg-gold-light: var(--cg-blue-pale);
    --cg-cream: var(--cg-gray-light);
}

/* --- Typography --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Inter:wght@400;500;600&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #e5e7eb; /* Cool Gray un peu plus prononcé pour mieux contraster avec les cartes blanches */
    color: var(--cg-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > .container {
    flex: 1;
}

h1, h2, h3, h4, h5, .card-title, .display-4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--cg-green-dark);
}

/* --- Navbar Premium --- */
.cg-navbar {
    background: #134024 !important; /* Perfect middle dark green */
    box-shadow: 0 8px 32px rgba(27, 107, 58, 0.25);
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cg-navbar .navbar-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.5px;
    color: #fff !important;
}

.brand-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

.brand-cardie {
    color: #8cc63f;
}

.brand-golf {
    color: #5bb0c9;
}

/* Hero overrides brand colors */
.hero-brand .brand-cardie {
    color: #8cc63f;
}

.cg-navbar .nav-link {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: rgba(255,255,255,0.7) !important;
    padding: 0.5rem 1rem !important;
    margin: 0 0.15rem;
    border-radius: 50rem;
    transition: all 0.25s ease;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.cg-navbar .nav-link:hover,
.cg-navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.cg-navbar-btn {
    background: #8cc63f !important;
    color: #0a1f12 !important;
    font-weight: 700;
    border-radius: 50rem !important;
    padding: 0.5rem 1.25rem !important;
    transition: all 0.25s ease !important;
    border: none !important;
}

.cg-navbar-btn:hover {
    background: #7ebd38 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(140, 198, 63, 0.3) !important;
}

/* --- Cards --- */
.card {
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius);
    box-shadow: var(--cg-shadow);
    transition: var(--cg-transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--cg-shadow-hover);
}

.card-header {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

/* Stat cards with colored top accent */
.stat-card {
    border-top: 3px solid var(--cg-green);
    text-align: center;
}

.stat-card .card-body {
    padding: 1.25rem 1rem;
}

.stat-card .stat-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--cg-green-dark);
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--cg-text-muted);
    margin-bottom: 0.4rem;
}

.stat-card .stat-sub {
    font-size: 0.82rem;
    color: var(--cg-text-muted);
    margin-top: 0.3rem;
}

.stat-card.accent-gold { border-top-color: var(--cg-blue); }
.stat-card.accent-red { border-top-color: #dc3545; }
.stat-card.accent-blue { border-top-color: #4a90d9; }

/* --- Buttons --- */
.btn-success {
    background: linear-gradient(135deg, var(--cg-green) 0%, var(--cg-green-dark) 100%);
    border: none;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(26, 71, 42, 0.2);
    transition: var(--cg-transition);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--cg-green-light) 0%, var(--cg-green) 100%);
    box-shadow: 0 4px 12px rgba(26, 71, 42, 0.3);
    transform: translateY(-1px);
}

.btn-outline-success {
    color: var(--cg-green);
    border-color: var(--cg-green);
    font-weight: 600;
}

.btn-outline-success:hover {
    background: var(--cg-green);
    border-color: var(--cg-green);
    box-shadow: 0 2px 8px rgba(26, 71, 42, 0.2);
}

.btn-gold, .btn-blue {
    background: linear-gradient(135deg, var(--cg-blue) 0%, #2d6e88 100%);
    color: #fff;
    border: none;
    font-weight: 600;
}

.btn-gold:hover, .btn-blue:hover {
    background: linear-gradient(135deg, var(--cg-blue-light) 0%, var(--cg-blue) 100%);
    color: #fff;
}

/* --- Homepage Hero Section --- */
.homepage-hero {
    position: relative;
    width: 100%;
    overflow: visible;
}

.hero-bg-wrapper {
    width: 100%;
    line-height: 0;
}

.hero-bg-img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 65vh;
    object-fit: cover;
    object-position: center;
}

.hero-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-golfer {
    position: absolute;
    left: 0;
    bottom: -15%;
    height: 80%;
    width: auto;
    max-width: 15%;
    object-fit: contain;
    object-position: bottom left;
    z-index: 3;
}

.hero-bird {
    position: absolute;
    right: 18%;
    bottom: -10%;
    height: 75%;
    width: auto;
    max-width: 24%;
    object-fit: contain;
    object-position: bottom right;
    z-index: 3;
    pointer-events: none;
}

.hero-text {
    position: relative;
    z-index: 4;
    text-align: left;
    max-width: 700px;
    margin-left: 8%;
    margin-right: auto;
    padding: 2rem 0;
}

.hero-text h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.05;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.7);
}

.hero-text p {
    font-size: 1.25rem;
    font-weight: 300;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.6);
}

.hero-buttons {
    display: flex;
    gap: 0.75rem;
}

.hero-buttons .btn {
    padding: 0.75rem 1.8rem;
    font-size: 1.1rem;
}

.hero-buttons .btn-success {
    background: #175700;
    border: none;
}

.hero-buttons .btn-success:hover {
    background: #1e6b00;
}

.hero-buttons .btn-outline-light {
    border: 2px solid rgba(255,255,255,0.7);
    color: #fff;
}

.hero-buttons .btn-outline-light:hover {
    background: rgba(255,255,255,0.15);
}

/* --- How It Works Section --- */
.homepage-how {
    background: #ffffff; /* Fond blanc pur pour bien contraster avec le fond gris perle principal */
    padding: 3rem 1rem 4rem;
    text-align: center;
    overflow: hidden;
    margin-top: -2px;
}

.homepage-how h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--cg-green-dark);
    margin-bottom: 2.5rem;
}

.how-steps {
    display: flex;
    justify-content: center;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.how-step {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    text-align: center;
}

.how-step img {
    max-height: 220px;
    max-width: 100%;
    width: auto;
    margin-bottom: 1.25rem;
}

.how-step h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--cg-green-dark);
    margin-bottom: 0.5rem;
}

.how-step p {
    font-size: 0.95rem;
    color: var(--cg-text);
    line-height: 1.5;
}

/* --- Homepage Responsive --- */
@media (max-width: 992px) {
    .hero-text {
        margin-left: 8%;
    }
    .hero-text h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .hero-golfer {
        max-width: 28%;
    }
    .hero-bird {
        max-width: 22%;
        right: 2%;
    }
    .hero-text {
        margin-left: 5%;
        max-width: 65%;
        padding-top: 3.5rem;
    }
    .hero-text h1 {
        font-size: 1.3rem;
        margin-bottom: 0.3rem;
    }
    .hero-text p {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
        line-height: 1.3;
    }
    .hero-bg-img {
        max-height: none;
        min-height: 38vh;
    }
    .hero-buttons .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    .how-steps {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    .homepage-how h2 {
        font-size: 1.8rem;
    }
}

/* --- Tables --- */
.table {
    border-radius: var(--cg-radius-sm);
    overflow: hidden;
}

.table thead th {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-success {
    --bs-table-bg: var(--cg-green-dark) !important;
    --bs-table-color: #fff !important;
}

.table-success th {
    background-color: var(--cg-green-dark) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,0.1) !important;
}

/* --- Tabs --- */
.nav-tabs {
    border-bottom: 2px solid var(--cg-border);
}

.nav-tabs .nav-link {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cg-text-muted);
    border: none;
    padding: 0.75rem 1.2rem;
    transition: var(--cg-transition);
}

.nav-tabs .nav-link:hover {
    color: var(--cg-green);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--cg-green-dark);
    border: none;
    border-bottom: 3px solid var(--cg-blue);
    background: transparent;
}

.nav-tabs .nav-link.disabled {
    color: var(--cg-border);
}

/* --- Alerts --- */
.alert {
    border-radius: var(--cg-radius-sm);
    border: none;
    font-weight: 500;
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
    color: #1565c0;
}

.alert-warning {
    background: linear-gradient(135deg, var(--cg-blue-pale) 0%, #fef9e7 100%);
    color: #7c6a1e;
}

.alert-success {
    background: linear-gradient(135deg, var(--cg-green-pale) 0%, #f1f8f3 100%);
    color: var(--cg-green-dark);
}

.alert-danger {
    background: linear-gradient(135deg, #fde8e8 0%, #fdf2f2 100%);
    color: #991b1b;
}

/* --- Badges --- */
.badge.bg-success {
    background: var(--cg-green) !important;
    font-weight: 600;
}

.badge-gold, .badge-blue {
    background: var(--cg-blue);
    color: #fff;
    font-weight: 600;
}

/* --- Forms --- */
.form-control, .form-select {
    border-radius: var(--cg-radius-sm);
    border-color: var(--cg-border);
    transition: var(--cg-transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--cg-green);
    box-shadow: 0 0 0 0.2rem rgba(45, 106, 79, 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cg-green-dark);
}

/* --- Auth pages --- */
.auth-card {
    border: none;
    border-radius: var(--cg-radius);
    box-shadow: 0 8px 32px rgba(26, 71, 42, 0.1);
}

.auth-card .card-body {
    padding: 2.5rem;
}

.auth-card h3 {
    color: var(--cg-green-dark);
    margin-bottom: 1.5rem;
}

/* --- Section headings --- */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cg-green-dark);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--cg-blue);
    display: inline-block;
    margin-bottom: 1rem;
}

/* --- Page titles --- */
.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--cg-green-dark);
    margin-bottom: 1.5rem;
}

.page-title .title-accent {
    color: var(--cg-blue);
}

/* --- Stats specific --- */
.stat-card .text-success { color: var(--cg-green) !important; }

/* Progress bars for percentages */
.stat-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--cg-green-pale);
    margin-top: 0.5rem;
    overflow: hidden;
}

.stat-progress .stat-progress-bar {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--cg-green) 0%, var(--cg-green-light) 100%);
    transition: width 0.6s ease;
}

.stat-progress .stat-progress-bar.bar-gold,
.stat-progress .stat-progress-bar.bar-blue {
    background: linear-gradient(90deg, var(--cg-blue) 0%, var(--cg-blue-light) 100%);
}

.stat-progress .stat-progress-bar.bar-red {
    background: linear-gradient(90deg, #dc3545 0%, #e76f7e 100%);
}

/* --- Footer Premium --- */
.site-footer {
    background: #0f331e; /* Slightly darker than header to anchor the page, but still green */
    color: rgba(255,255,255,0.6);
    padding: 2rem 0 1.25rem;
    margin-top: 0;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.site-footer a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.site-footer a:hover {
    color: #8cc63f;
    transform: translateX(3px);
}

.site-footer .footer-heading {
    font-family: 'Montserrat', sans-serif;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    text-transform: uppercase;
}

/* --- Scorecard enhancements --- */
.table-dark {
    --bs-table-bg: var(--cg-green-dark) !important;
    --bs-table-color: #fff !important;
}

/* --- Modals --- */
.modal-content {
    border-radius: var(--cg-radius);
    border: none;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15);
}

/* --- Misc utilities --- */
.text-gold, .text-blue { color: var(--cg-blue) !important; }
.bg-green-pale { background-color: var(--cg-green-pale) !important; }

/* Fade-in animation for page content */
.container {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive tweaks --- */
@media (max-width: 768px) {
    .hero-section {
        padding: 2.5rem 0;
        margin: -1.5rem -0.75rem 1.5rem;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
    .stat-card .stat-value {
        font-size: 1.6rem;
    }
}

/* ============================================================
   Golf scorecard notation symbols (preserved from original)
   ============================================================ */
.golf-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    font-weight: bold;
    font-size: 0.9em;
    line-height: 1;
    position: relative;
}

/* Birdie: single circle */
.gs-birdie {
    border: 1px solid var(--cg-green);
    border-radius: 50%;
    color: var(--cg-green);
}

/* Eagle: double circle */
.gs-eagle {
    border: 1px solid var(--cg-green);
    border-radius: 50%;
    color: var(--cg-green);
}
.gs-eagle::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border: 1px solid var(--cg-green);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Albatross: triple circle */
.gs-albatross {
    border: 1px solid #4a90d9;
    border-radius: 50%;
    color: #4a90d9;
}
.gs-albatross::before {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border: 1px solid #4a90d9;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.gs-albatross::after {
    content: '';
    position: absolute;
    width: 34px;
    height: 34px;
    border: 1px solid #4a90d9;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Bogey: single square */
.gs-bogey {
    border: 1px solid #dc3545;
    color: #dc3545;
}

/* Double bogey: double square */
.gs-double-bogey {
    border: 1px solid #dc3545;
    color: #dc3545;
}
.gs-double-bogey::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border: 1px solid #dc3545;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Triple bogey or worse: diamond */
.gs-triple-bogey {
    color: #dc3545;
}
.gs-triple-bogey::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 1px solid #dc3545;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* --- Clearable search inputs --- */
.clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    border: none;
    background: none;
    color: #adb5bd;
    font-size: 1.1rem;
    padding: 0;
    cursor: pointer;
    line-height: 1;
    z-index: 5;
    width: 20px;
    height: 20px;
    text-align: center;
}
.clear-btn:hover {
    color: #dc3545;
}

/* ============================================================
   Shared Admin & Stats Layout Components
   ============================================================ */

/* Detailed scorecard rows toggle */
.detailed-hidden {
    display: none !important;
}

/* Stats Card Harmonization */
.stat-card, .card {
    border-radius: 1.5rem !important;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

/* Elegant Tabs */
.nav-tabs {
    border-bottom: none;
    gap: 0.5rem;
    margin-bottom: 2rem !important;
}
.nav-tabs .nav-link {
    border: none;
    background-color: transparent;
    color: #6c757d;
    font-weight: 600;
    border-radius: 50rem;
    padding: 0.6rem 1.5rem;
    transition: all 0.2s ease;
}
.nav-tabs .nav-link:hover:not(.disabled) {
    background-color: rgba(25, 135, 84, 0.05);
    color: #198754;
}
.nav-tabs .nav-link.active {
    background-color: #198754;
    color: white;
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.2);
}
.nav-tabs .nav-link.disabled {
    color: #adb5bd;
}

/* Table Styling */
.table-hover tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.table-hover tbody tr:hover {
    background-color: #fafbfa !important;
    transform: translateY(-1px);
}
