/* ===== Google Fonts Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ===== Theme Variables from Figma ===== */
:root {
    --font-size: 16px;
    --background: #ffffff;
    --foreground: oklch(0.145 0 0);
    --card: #ffffff;
    --card-foreground: oklch(0.145 0 0);
    --popover: oklch(1 0 0);
    --popover-foreground: oklch(0.145 0 0);
    --primary: #030213;
    --primary-foreground: oklch(1 0 0);
    --secondary: oklch(0.95 0.0058 264.53);
    --secondary-foreground: #030213;
    --muted: #ececf0;
    --muted-foreground: #717182;
    --accent: #e9ebef;
    --accent-foreground: #030213;
    --destructive: #d4183d;
    --destructive-foreground: #ffffff;
    --border: rgba(0, 0, 0, 0.1);
    --input: transparent;
    --input-background: #f3f3f5;
    --switch-background: #cbced4;
    --font-weight-medium: 500;
    --font-weight-normal: 400;
    --ring: oklch(0.708 0 0);
    --radius: 0.625rem;
    
    /* Tennis Theme Colors - Blue Hardcourt */
    --tennis-court: #ADD8E6;
    --tennis-court-medium: #4d94ff;
    --tennis-court-dark: #00008B;
    --tennis-court-darker: #00006B;
    --tennis-court-gradient-start: #4d94ff;
    --tennis-court-gradient-middle: #3d7acc;
    --tennis-court-gradient-end: #5ca3ff;
    --tennis-court-light: #FFFFFF;
    --tennis-accent: #FFD700;
    --tennis-accent-secondary: #FF69B4;
    --tennis-ball: #DFFF00;
    --tennis-white: #FFFFFF;
    --tennis-text-gray: #5a5a5a;
    
    /* Tennis Court Line SVG Pattern - Faint White Lines (Opacity 0.2) */
    --tennis-court-lines: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='0.2'%3E%3C!-- Horizontal center line --%3E%3Cline x1='0' y1='100' x2='200' y2='100' stroke='white' stroke-width='3'/%3E%3C!-- Vertical center line --%3E%3Cline x1='100' y1='0' x2='100' y2='200' stroke='white' stroke-width='2'/%3E%3C!-- Service boxes --%3E%3Cline x1='50' y1='0' x2='50' y2='200' stroke='white' stroke-width='1.5'/%3E%3Cline x1='150' y1='0' x2='150' y2='200' stroke='white' stroke-width='1.5'/%3E%3Cline x1='0' y1='50' x2='200' y2='50' stroke='white' stroke-width='1.5'/%3E%3Cline x1='0' y1='150' x2='200' y2='150' stroke='white' stroke-width='1.5'/%3E%3C/g%3E%3C/svg%3E");
}

.dark {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.145 0 0);
    --card-foreground: oklch(0.985 0 0);
    --popover: oklch(0.145 0 0);
    --popover-foreground: oklch(0.985 0 0);
    --primary: oklch(0.985 0 0);
    --primary-foreground: oklch(0.205 0 0);
    --secondary: oklch(0.269 0 0);
    --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.269 0 0);
    --muted-foreground: oklch(0.708 0 0);
    --accent: oklch(0.269 0 0);
    --accent-foreground: oklch(0.985 0 0);
    --destructive: oklch(0.396 0.141 25.723);
    --destructive-foreground: oklch(0.637 0.237 25.331);
    --border: oklch(0.269 0 0);
    --input: oklch(0.269 0 0);
    --ring: oklch(0.439 0 0);
}

/* ===== Base Styles ===== */
*, *::before, *::after {
    box-sizing: border-box;
    border-color: var(--border);
}

html {
    font-size: var(--font-size);
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    
    /* Blue Hardcourt Gradient Background */
    background: linear-gradient(135deg, 
        var(--tennis-court-gradient-start) 0%, 
        var(--tennis-court-gradient-middle) 50%, 
        var(--tennis-court-gradient-end) 100%);
    
    /* Tennis Court Lines Pattern Overlay */
    background-image: 
        var(--tennis-court-lines),
        linear-gradient(135deg, 
            var(--tennis-court-gradient-start) 0%, 
            var(--tennis-court-gradient-middle) 50%, 
            var(--tennis-court-gradient-end) 100%);
    
    background-repeat: repeat, no-repeat;
    background-size: 200px 200px, cover;
    background-attachment: fixed;
    min-height: 100vh;
}

/* ===== Typography - Pixelated Headings ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-weight: var(--font-weight-normal);
    line-height: 1.6;
    letter-spacing: 1px;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.2rem;
}

h4 {
    font-size: 1rem;
}

h5, h6 {
    font-size: 0.9rem;
}

/* ===== Body Text - Serif (Georgia) for Content Consistency ===== */
p, span, div, a, li, td, th {
    font-family: 'Georgia', 'Times New Roman', serif;
}

label, button {
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
}

input, textarea, select {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
}


/* ===== Focus Styles ===== */
h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus {
    outline: none;
}

/* ===== Link Styles ===== */
a {
    color: var(--tennis-court-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--tennis-accent);
    text-decoration: underline;
}

.btn-link {
    color: var(--tennis-court-dark);
}

/* ===== Button Styles ===== */
.btn-primary {
    color: var(--tennis-white);
    background-color: var(--tennis-court-dark);
    border-color: var(--tennis-court-darker);
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--tennis-court-darker);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--tennis-accent);
}

/* ===== Content Utilities ===== */
.content {
    padding-top: 1.1rem;
}

/* ===== Form Validation Styles ===== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.875rem;
}

/* ===== Blazor Error UI ===== */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* ===== Loading Progress Indicator ===== */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--tennis-accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--tennis-white);
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ===== Code Styling ===== */
code {
    color: var(--tennis-accent-secondary);
    background-color: rgba(0, 0, 139, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

/* ===== Form Floating Labels ===== */
.form-floating > .form-control-plaintext::placeholder, 
.form-floating > .form-control::placeholder {
    color: var(--muted-foreground);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, 
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===== Utility Classes ===== */
.text-pixel {
    font-family: 'Press Start 2P', 'Courier New', monospace;
}

.text-tennis-dark {
    color: var(--tennis-court-dark);
}

.text-tennis-accent {
    color: var(--tennis-accent);
}

.bg-tennis-court {
    background-color: var(--tennis-court);
}

.bg-tennis-dark {
    background-color: var(--tennis-court-dark);
}

/* ===== Scrollbar Styling (for WebKit browsers) ===== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--tennis-court-gradient-middle);
}

::-webkit-scrollbar-thumb {
    background: var(--tennis-court-dark);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tennis-court-darker);
}

/* ===== Selection Styling ===== */
::selection {
    background-color: var(--tennis-accent);
    color: var(--tennis-court-dark);
}

::-moz-selection {
    background-color: var(--tennis-accent);
    color: var(--tennis-court-dark);
}

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}