
/*
 * Global stylesheet for ShotGeek.
 * Provides base typography, color helpers, and responsive rules for
 * player comparison cards.  Desktop styling mirrors the original theme
 * while mobile tweaks improve readability and tap usability.
 */

/*
 * Design tokens used across the site.  Colors match the existing desktop
 * palette so re‑using these variables does not alter the desktop look and
 * feel.  Additional tokens enable dark mode, spacing, and component
 * elevation.  Font sizing scales up slightly on narrow viewports to keep
 * content legible without zooming.
 */
:root {
    /* Color scheme */
    --bg: #fff;
    --surface: #f7f7f8;
    --text: #111;
    --muted: #5c5f62;
    --border: #e5e7eb;
    --primary: #f1543a; /* matches existing brand red */
    --on-primary: #fff;

    /* Shape & elevation */
    --radius: 12px;
    --elev: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.06);

    /* Typography & spacing */
    --font-base: 16px;
    --font-heading: 20px;
    --space-unit: 8px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b0c0e;
        --surface: #16181b;
        --text: #f1f5f9;
        --muted: #a1a1aa;
        --border: #2a2e34;
        --primary: #ff554d;
        --on-primary: #0b0c0e;
        --elev: none;
    }
}

@media (max-width: 576px) {
    :root {
        --font-base: 18px;
        --font-heading: 22px;
    }
}

body {
    font-family: "Courier New", Courier, monospace;
    font-size: var(--font-base);
    background: var(--bg);
    color: var(--text);
}

/* Ensure content isn't hidden behind sticky bottom bars on mobile */
@media (max-width: 576px) {
    body {
        padding-bottom: 96px;
    }
}

a {
    text-decoration: none;
    font-weight: bold;
    color: var(--primary);
}

a:hover {
    color: var(--primary);
    opacity: .85;
}

/* Smaller bottom padding on desktop where sticky bar is hidden */
@media (min-width: 768px) {
    body {
        padding-bottom: 24px;
    }
}

.navbar-nav .nav-link {
    color: #b4513e !important; /* existing desktop style */
}

/* Button hierarchy */
.btn-primary {
    background-color: var(--primary);
    color: var(--on-primary);
    border: none;
}

.btn-primary:hover {
    background-color: var(--primary);
    opacity: .9;
    color: var(--on-primary);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--on-primary);
}

.btn-tertiary {
    background: transparent;
    border: none;
    color: var(--primary);
}

.btn-tertiary:hover {
    background: transparent;
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Loader image centered over a translucent overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.img-flex {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-overlay img {
    max-width: calc(100% - 20px);
    max-height: calc(100% - 20px);
    height: auto;
}

/* Spinner centered inside the overlay */
.loader-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

.navbar-logo {
    max-height: 60px;
}

@media (min-width: 992px) {
    .navbar-logo {
        max-height: 120px;
    }
}

/* Smaller navbar on mobile */
@media (max-width: 768px) {
    .navbar {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .navbar-brand {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }
    
    .navbar-nav .nav-link {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        font-size: 0.9rem;
    }
}

/* ===== Search Form Styles ===== */
.form-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 500px;
}

.form-inline p {
    margin: 0;
    flex-grow: 1;
    position: relative;
}

.form-inline input {
    width: 100%;
    padding: 8px 15px 8px 35px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: var(--surface);
    font-family: inherit;
}

.form-inline input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(241, 84, 58, 0.2);
    background-color: var(--bg);
}

.form-inline .btn {
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 38px;
    cursor: pointer;
}

.form-inline .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Search icon */
.form-inline p::before {
    content: "🔍";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    pointer-events: none;
}

/* ===== Responsive Styles for Search Form ===== */
@media (max-width: 576px) {
    .form-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .form-inline .btn {
        width: 100%;
    }
}

/* Player card adjustments */
.player-card {
    padding: calc(var(--space-unit) * 2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--elev);
}

.player-card img.player-avatar {
    max-width: 75%;
    height: auto;
}

@media (max-width: 576px) {
    .player-card img.player-avatar {
        max-width: 60%;
    }
}

.player-name {
    color: #b4513e;
    font-size: var(--font-heading);
}

.player-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-unit);
    padding-left: 0;
    margin-bottom: 0;
}

.player-stats .stat-item {
    display: contents;
}

.player-stats dt {
    font-weight: 600;
    color: var(--muted);
}

.player-stats dd {
    margin: 0 0 var(--space-unit) 0;
}

@media (max-width: 360px) {
    .player-stats {
        grid-template-columns: 1fr;
    }
}

.player-card form {
    margin-bottom: 0.75rem;
}

.player-card .btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.75rem;
}

@media (max-width: 576px) {
    .player-card .btn {
        width: 100%;
    }
}

/* Search field layout ensures label, input and button stay readable on phones */
.player-search-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.player-search-field input {
    min-height: 48px;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 0 0.5rem;
}

.player-search-field button {
    min-height: 48px;
    border-radius: 10px;
    margin-top: 8px;
}

/* Skeleton placeholder with reduced-motion respect */
.skeleton {
    background: var(--border);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    height: 100%;
    width: 150%;
    background: linear-gradient(90deg, var(--border) 25%, var(--surface) 37%, var(--border) 63%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton::after {
        animation: none;
    }
}

.avatar-skeleton {
    width: 128px;
    height: 128px;
    margin: 0 auto;
}

/* Sticky compare bar at bottom */
.compare-bar {
    position: fixed;
    inset: auto 0 0 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    box-shadow: var(--elev);
    text-align: center;
    z-index: 9999;
}

/* hide compare bar on desktop */
@media (min-width: 768px) {
    .compare-bar {
        display: none !important;
    }
}

.compare-bar button {
    min-height: 48px;
    border-radius: 10px;
    width: 100%;
}

.jumbotron {
    background-color: #f8f9fa;
    padding: 150px 0;
}

.jumbotron h1 {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
}

.jumbotron p {
    font-size: 24px;
    margin-bottom: 40px;
}

.col-md-6 {
    margin-bottom: 30px;
}

.col-md-6 img {
    border-radius: 5px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
}

.col-md-6 h2 {
    font-size: 28px;
    font-weight: bold;
    margin-top: 20px;
}

.col-md-6 p {
    font-size: 18px;
}

.table thead th {
    background-color: #f2f2f2;
    color: #333;
    font-weight: bold;
}

.table tbody td {
    text-align: center;
}

.news-title {
            margin-bottom: 10px;
        }
.news-link {
            display: inline-block;
            background-color: #007bff;
            color: #fff;
            text-decoration: none;
            padding: 10px 20px;
            border-radius: 5px;
        }
.news-link:hover {
            background-color: #0056b3;
   }

.custom-square {
    background-color: #7E354D;
    border-radius: 15px;
    width: 100%;
    padding-top: 100%; /* This makes the div a perfect square */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white; /* Text color */
    overflow: hidden; /* Ensures content stays within the rounded corners */
}

.custom-square img {
    max-width: 80%;
    max-height: 80%;
    margin-bottom: 10px;
    border-radius: 10px;
}

.custom-square p {
    position: absolute;
    bottom: 10px;
    width: 100%;
    padding: 0 10px;
}

.container .row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.stat-item {
    flex: 1 1 50%; /* Make each stat item take up 50% of the container's width */
    margin-bottom: 10px; /* Add some spacing between rows */
}


.rounded-frame {
    border-radius: 15px; /* Adjust the value as needed */
    overflow: hidden; /* Ensure inner content doesn't overflow the rounded corners */
}

.player-details {
    font-size: 0.9rem; /* Decrease font size */
}

.player-details h4 {
    font-size: 1.2rem; /* Decrease font size of player names */
}

.player-details .stat-item {
    margin-bottom: 5px; /* Adjust spacing if needed */
}

.mini-profile-widget img.avatar {
    max-width: 80%; /* Adjust image size if needed */
    height: auto;
}

/* Ensure the comparison chart scales responsively */
#ComparisonChart, #StatChart {
    width: 100% !important;
    display: block;
}

/* On small screens (≤576px), make the chart 70% of the viewport height */
@media (max-width: 576px) {
    #ComparisonChart, #StatChart {
        height: 70vh !important;
    }
}
