/**
 * THE GAME - Main Stylesheet
 * Quilter Labs / Q-PER Bowl Styling
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --gold: #FFD700;
    --gold-dark: #D4AF00;
    --gold-light: #FFE44D;
    --black: #000000;
    --dark-bg: #1a1a1a;
    --darker-bg: #0d0d0d;
    --card-bg: #2d2d2d;
    --text-white: #ffffff;
    --text-gray: #cccccc;
    --text-muted: #888888;
    --success: #28a745;
    --success-dark: #1e7e34;
    --error: #dc3545;
    --error-dark: #c82333;
    --warning: #ffc107;
    --info: #17a2b8;
    --border-radius: 10px;
    --shadow: 0 10px 30px rgba(0,0,0,0.8);
    --shadow-gold: 0 0 20px rgba(255,215,0,0.3);
    --font-display: 'Impact', 'Arial Black', Arial, sans-serif;
    --font-body: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 50%, var(--darker-bg) 100%);
    color: var(--text-white);
    min-height: 100vh;
    line-height: 1.6;
}

/* Textured background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,215,0,0.02) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255,215,0,0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--gold-light);
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

h1 { font-size: 3em; margin-bottom: 20px; }
h2 { font-size: 2.2em; margin-bottom: 15px; }
h3 { font-size: 1.6em; margin-bottom: 10px; }

p {
    margin-bottom: 1em;
    color: var(--text-gray);
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 40px 0;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
    background: linear-gradient(135deg, var(--black) 0%, var(--dark-bg) 100%);
    border-bottom: 3px solid var(--gold);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 50px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.8em;
    color: var(--gold);
    text-shadow: 2px 2px 0px var(--black);
}

.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-menu a {
    font-family: var(--font-display);
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255,215,0,0.1);
    box-shadow: inset 0 0 10px rgba(255,215,0,0.2);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: var(--text-gray);
}

/* ============================================
   CARDS & PANELS
   ============================================ */
.card {
    background: linear-gradient(135deg, var(--black) 0%, var(--dark-bg) 100%);
    border: 3px solid var(--gold);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow), inset 0 2px 0 rgba(255,215,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 2px solid rgba(255,215,0,0.3);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-title {
    margin-bottom: 0;
}

.card-body {
    color: var(--text-gray);
}

.card-footer {
    border-top: 2px solid rgba(255,215,0,0.3);
    padding-top: 15px;
    margin-top: 20px;
}

/* Game Slot Cards */
.game-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid rgba(255,215,0,0.5);
    transition: all 0.3s;
}

.game-card:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
    transform: translateY(-2px);
}

.game-card.full {
    opacity: 0.6;
    border-color: rgba(255,215,0,0.2);
}

.game-card.full:hover {
    transform: none;
    box-shadow: none;
}

.game-info h3 {
    font-size: 1.4em;
    margin-bottom: 5px;
}

.game-meta {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.9em;
}

.game-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.game-slots {
    text-align: right;
}

.slots-count {
    font-family: var(--font-display);
    font-size: 2em;
    color: var(--gold);
}

.slots-label {
    font-size: 0.8em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 15px 30px;
    font-family: var(--font-display);
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 3px solid var(--gold);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--black);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    box-shadow: var(--shadow-gold);
    transform: scale(1.02);
    color: var(--black);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--card-bg) 100%);
    color: var(--gold);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--card-bg) 0%, #3d3d3d 100%);
    box-shadow: var(--shadow-gold);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: var(--text-white);
    border-color: var(--success);
}

.btn-success:hover {
    box-shadow: 0 0 20px rgba(40,167,69,0.5);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error) 0%, var(--error-dark) 100%);
    color: var(--text-white);
    border-color: var(--error);
}

.btn-danger:hover {
    box-shadow: 0 0 20px rgba(220,53,69,0.5);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.9em;
}

.btn-lg {
    padding: 20px 40px;
    font-size: 1.3em;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-family: var(--font-display);
    color: var(--gold);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.form-control {
    width: 100%;
    padding: 15px;
    font-size: 1em;
    font-family: var(--font-body);
    background: rgba(255,255,255,0.95);
    border: 2px solid var(--gold);
    border-radius: 5px;
    color: var(--black);
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(255,215,0,0.4);
    border-color: var(--gold-light);
}

.form-control::placeholder {
    color: #999;
}

.form-control.error {
    border-color: var(--error);
}

.form-error {
    color: var(--error);
    font-size: 0.85em;
    margin-top: 5px;
}

.form-help {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-top: 5px;
}

/* Checkboxes */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

.form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--gold);
    cursor: pointer;
    margin-top: 3px;
}

.form-check label {
    color: var(--text-gray);
    cursor: pointer;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Select */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23FFD700' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 45px;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255,215,0,0.2);
}

.table th {
    font-family: var(--font-display);
    color: var(--gold);
    background: rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table tr:hover td {
    background: rgba(255,215,0,0.05);
}

.table .actions {
    white-space: nowrap;
}

/* ============================================
   FLASH MESSAGES
   ============================================ */
.flash-messages {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.flash-success {
    background: linear-gradient(135deg, #1e7e34 0%, #28a745 100%);
    border: 2px solid var(--success);
}

.flash-error {
    background: linear-gradient(135deg, #c82333 0%, #dc3545 100%);
    border: 2px solid var(--error);
}

.flash-warning {
    background: linear-gradient(135deg, #d39e00 0%, #ffc107 100%);
    border: 2px solid var(--warning);
    color: var(--black);
}

.flash-info {
    background: linear-gradient(135deg, #138496 0%, #17a2b8 100%);
    border: 2px solid var(--info);
}

.flash-icon {
    font-size: 1.5em;
}

.flash-text {
    flex: 1;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5em;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.flash-close:hover {
    opacity: 1;
}

/* ============================================
   BADGES & STATUS
   ============================================ */
.badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: var(--black);
}

.badge-danger {
    background: var(--error);
    color: white;
}

.badge-info {
    background: var(--info);
    color: white;
}

.badge-gold {
    background: var(--gold);
    color: var(--black);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--black) 0%, var(--dark-bg) 100%);
    border-bottom: 5px solid var(--gold);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '🎸';
    position: absolute;
    font-size: 300px;
    opacity: 0.03;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hero h1 {
    font-size: 4em;
    margin-bottom: 10px;
    text-shadow: 3px 3px 0px var(--black), 5px 5px 10px rgba(0,0,0,0.8);
}

.hero-subtitle {
    font-size: 1.5em;
    color: var(--gold);
    margin-bottom: 20px;
    font-family: var(--font-display);
    letter-spacing: 3px;
}

.hero p {
    font-size: 1.2em;
    max-width: 600px;
    margin: 0 auto 30px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-warning {
    margin-top: 40px;
    padding: 20px;
    background: rgba(255,193,7,0.1);
    border: 2px solid var(--warning);
    border-radius: var(--border-radius);
    display: inline-block;
}

.hero-warning p {
    color: var(--warning);
    font-weight: bold;
    margin: 0;
    font-size: 1.1em;
}

/* ============================================
   PRIZE SECTION
   ============================================ */
.prizes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.prize-card {
    text-align: center;
    padding: 40px;
}

.prize-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.prize-card h3 {
    margin-bottom: 10px;
}

.prize-card p {
    color: var(--text-gray);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--black);
    border-top: 3px solid var(--gold);
    padding: 40px 0;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    text-align: center;
    padding: 25px;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 3em;
    color: var(--gold);
    line-height: 1;
}

.stat-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* Player roster */
.roster-list {
    list-style: none;
}

.roster-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255,215,0,0.2);
}

.roster-item:last-child {
    border-bottom: none;
}

.roster-player {
    display: flex;
    align-items: center;
    gap: 15px;
}

.roster-slot {
    width: 40px;
    height: 40px;
    background: var(--gold);
    color: var(--black);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.2em;
}

.roster-slot.substitute {
    background: var(--card-bg);
    color: var(--gold);
    border: 2px solid var(--gold);
}

.roster-name {
    font-weight: bold;
}

.roster-contact {
    color: var(--text-muted);
    font-size: 0.9em;
}

.check-in-btn {
    width: 120px;
}

.check-in-btn.checked {
    background: var(--success);
    border-color: var(--success);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--dark-bg);
    border: 3px solid var(--gold);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 2px solid rgba(255,215,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 1.5em;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 2px solid rgba(255,215,0,0.3);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,215,0,0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    h1 { font-size: 2em; }
    h2 { font-size: 1.6em; }
    
    .hero h1 { font-size: 2.5em; }
    .hero-subtitle { font-size: 1.2em; }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .nav-menu a {
        font-size: 0.9em;
        padding: 8px 12px;
    }
    
    .game-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .game-slots {
        text-align: center;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 1em;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .flash-messages {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--error); }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-3 { gap: 30px; }

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

.w-100 { width: 100%; }
