/* TryoutHQ - Global Styles */

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

:root {
    --primary: #1e3a5f;
    --primary-dark: #152a45;
    --secondary: #ffffff;
    --accent: #4f46e5;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --black: #111;
    --gray-900: #1f2937;
    --gray-700: #374151;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 20px;
}

.logo img {
    height: 40px;
    width: auto;
    border-radius: var(--radius-sm);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
}

/* Navigation */
nav {
    display: flex;
    gap: 8px;
}

nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

nav a:hover {
    background: var(--gray-100);
    color: var(--primary);
}

nav a.active {
    background: var(--primary);
    color: white;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.required {
    color: var(--error);
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-family: inherit;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

input:disabled, select:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

select {
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge-info {
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent);
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #166534;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #991b1b;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #92400e;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--gray-500);
}

tr:hover {
    background: var(--gray-50);
}

/* Tryout Cards */
.tryout-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--gray-200);
    margin-bottom: 16px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.tryout-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}

.tryout-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.tryout-card h3 {
    color: var(--primary);
    margin-bottom: 4px;
}

.tryout-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 16px;
}

.tryout-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.age-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.age-tag {
    background: var(--gray-100);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

/* Progress Bar */
.progress-container {
    background: var(--white);
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-step {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-400);
}

.progress-step.active {
    color: var(--primary);
}

.progress-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Success Screen */
.success-screen {
    text-align: center;
    padding: 48px 24px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 40px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 80px 24px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 32px;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 64px 24px;
}

.feature-card {
    text-align: center;
    padding: 32px;
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: rgba(30, 58, 95, 0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

/* Club Page Header */
.club-header {
    background: var(--primary);
    color: white;
    padding: 48px 24px;
}

.club-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.club-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.club-logo img {
    max-width: 100%;
    max-height: 100%;
}

.club-header h1 {
    margin-bottom: 4px;
}

.club-header p {
    opacity: 0.9;
}

/* Admin Sidebar */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--gray-900);
    color: white;
    padding: 24px 0;
    flex-shrink: 0;
}

.admin-sidebar .logo {
    color: white;
    padding: 0 24px;
    margin-bottom: 32px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-nav a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 3px solid var(--accent);
}

.admin-content {
    flex: 1;
    padding: 32px;
    background: var(--gray-100);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--gray-500);
    font-size: 14px;
}

/* Footer */
footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 48px 24px;
    text-align: center;
}

footer a {
    color: white;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .club-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        padding: 16px;
    }
    
    .admin-nav {
        display: flex;
        overflow-x: auto;
        gap: 8px;
    }
    
    .admin-nav a {
        padding: 8px 16px;
        white-space: nowrap;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    nav {
        width: 100%;
        justify-content: center;
    }
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

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

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

.modal {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.2s;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-400);
    line-height: 1;
}

/* Custom club theming */
[data-theme="club"] {
    --primary: var(--club-primary, #1e3a5f);
    --primary-dark: var(--club-primary-dark, #152a45);
}
