/* 
 * San Diego Archers Volunteer Timecard System
 * Shared Design System - CSS Custom Properties and Base Styles
 * Consolidated from styles.css, admin-styles.css, and leaderboard-styles.css
 */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    /* Color Palette - Modern and accessible */
    --primary-green: #059669;
    --primary-light: #10b981;
    --primary-dark: #047857;
    --accent-blue: #3b82f6;
    --success-green: #10b981;
    --warning-orange: #f59e0b;
    --error-red: #ef4444;
    --neutral-50: #f9fafb;
    --neutral-100: #f3f4f6;
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;
    --neutral-400: #9ca3af;
    --neutral-500: #6b7280;
    --neutral-600: #4b5563;
    --neutral-700: #374151;
    --neutral-800: #1f2937;
    --neutral-900: #111827;
    
    /* Modern shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Typography */
    --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    
    /* Spacing system */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    
    /* Animation and transitions */
    --transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-colors: color 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.1s ease;
    --transition-slow: all 0.3s ease;
    
    /* Layout breakpoints */
    --mobile-max: 479px;
    --tablet-min: 480px;
    --tablet-max: 767px;
    --desktop-min: 768px;
    --desktop-large: 1024px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    line-height: 1.5;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-feature-settings: normal;
    font-variation-settings: normal;
    line-height: 1.6;
    color: var(--neutral-900);
    background-color: var(--neutral-50);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===== SHARED LAYOUT COMPONENTS ===== */

/* Container system */
.container {
    max-width: 24rem; /* 384px - mobile first */
    margin: 0 auto;
    padding: var(--space-4);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

@media (min-width: 480px) {
    .container {
        max-width: 32rem; /* 512px - tablet */
        padding: var(--space-6);
        gap: var(--space-6);
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 40rem; /* 640px - desktop */
        padding: var(--space-8);
    }
}

/* Admin container override */
.container-admin {
    max-width: 48rem; /* 768px for admin */
}

/* Leaderboard container override */
.container-leaderboard {
    max-width: 40rem; /* 640px for leaderboard */
}

/* ===== SHARED COMPONENTS ===== */

/* Header styles */
.header {
    background: white;
    border-bottom: 1px solid var(--neutral-200);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-4);
    justify-content: flex-start;
}

.header-logo,
.logo {
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
}

.header-title-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neutral-900);
    line-height: 1.2;
    margin: 0;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
}

.nav-link {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-colors);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius);
}

.nav-link:hover {
    color: var(--primary-dark);
    background-color: var(--neutral-100);
}

.nav-separator {
    color: var(--neutral-400);
    font-weight: 300;
}

/* Page header styling (matching admin dashboard) */
.page-header {
    margin-bottom: var(--space-6);
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin: 0;
}
    flex: 1;
}

@media (min-width: 480px) {
    .header-content {
        padding: 0 var(--space-6);
        gap: var(--space-4);
    }
    
    .header-logo,
    .logo {
        width: 4.5rem;
        height: 4.5rem;
    }
    
    .header-title {
        font-size: 1.5rem;
    }
}

/* Button system */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: var(--radius-xl);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 2.75rem;
    user-select: none;
}

.btn:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button variants */
.btn-primary {
    background-color: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background-color: white;
    color: var(--neutral-700);
    border-color: var(--neutral-300);
}

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

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

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
    border-color: #dc2626;
}

/* Button sizes */
.btn-small {
    padding: var(--space-2) var(--space-4);
    font-size: 0.875rem;
    min-height: 2.25rem;
}

.btn-large {
    padding: var(--space-4) var(--space-8);
    font-size: 1.125rem;
    min-height: 3.5rem;
}

/* Form elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-group label {
    font-weight: 600;
    color: var(--neutral-700);
    font-size: 0.875rem;
    line-height: 1.25;
}

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--neutral-300);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    line-height: 1.5;
    transition: var(--transition-colors);
    background-color: white;
    color: var(--neutral-900);
}

.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgb(16 185 129 / 0.1);
}

.form-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--neutral-400);
}

/* Help text styling */
.help-text,
small.help-text {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin-top: var(--space-1);
    line-height: 1.4;
}

/* Card system */
.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--neutral-200);
}

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
    background-color: var(--neutral-50);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: var(--space-1);
}

.card-description {
    color: var(--neutral-600);
    font-size: 0.875rem;
}

.card-content {
    padding: var(--space-6);
}

/* Status messages */
.status-message {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    font-weight: 500;
    text-align: center;
    margin-bottom: var(--space-4);
    border: 1px solid transparent;
}

.status-success {
    background-color: var(--success-green);
    color: white;
    border-color: var(--success-green);
}

.status-error {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.status-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-color: #fed7aa;
}

.status-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-10);
    gap: var(--space-4);
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--neutral-200);
    border-top: 3px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table system */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th {
    background-color: var(--neutral-100);
    color: var(--neutral-700);
    font-weight: 600;
    text-align: left;
    padding: var(--space-4);
    border-bottom: 1px solid var(--neutral-200);
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--neutral-100);
    color: var(--neutral-900);
    font-size: 0.875rem;
}

.table tbody tr:hover {
    background-color: var(--neutral-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive table */
@media (max-width: 767px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
}

/* Utility classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

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

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.p-4 {
    padding: var(--space-4);
}

/* Footer styles */
.footer {
    margin-top: auto;
    padding-top: var(--space-8);
    text-align: center;
    color: var(--neutral-500);
    font-size: 0.875rem;
    border-top: 1px solid var(--neutral-200);
}

.footer a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

.logout-link {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-colors);
}

.logout-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}