/*
 * Swamp League - Main Stylesheet
 * Clean, modern fantasy sports design
 */

:root {
    /* Primary colors - Swamp theme with gold accents */
    --primary: #1a472a;
    --primary-dark: #0d2818;
    --primary-light: #2d5a3d;
    --accent: #d4af37;
    --accent-light: #f4d03f;

    /* Neutrals */
    --bg-dark: #0f1419;
    --bg-card: #1c2526;
    --bg-input: #2a3439;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Status colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Spacing */
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page {
    padding: 2rem 0;
}

/* Navigation */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-brand span {
    color: var(--accent);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.navbar-nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-user .username {
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--primary-light);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.0625rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: var(--bg-input);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.form-error {
    color: var(--danger);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0,0,0,0.2);
}

tr:hover {
    background: rgba(255,255,255,0.02);
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Spacing utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Text utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.font-bold { font-weight: 600; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-primary {
    background: var(--primary);
    color: var(--text-primary);
}

.badge-accent {
    background: var(--accent);
    color: var(--bg-dark);
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Position badges */
.position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 1.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

.position-CAB { background: #1e40af; color: white; }
.position-ELEC { background: #7c3aed; color: white; }
.position-ADV { background: #0891b2; color: white; }
.position-COMM { background: #0d9488; color: white; }
.position-MED { background: #c026d3; color: white; }
.position-OLI { background: #d4af37; color: #1a1a1a; }
.position-FAM { background: #e11d48; color: white; }
.position-LEG { background: #4b5563; color: white; }
.position-WILD { background: #059669; color: white; }

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

/* Stats */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Player card */
.player-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: var(--bg-input);
    border-radius: var(--radius);
    transition: background 0.2s;
}

.player-card:hover {
    background: var(--primary-light);
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
    color: var(--text-primary);
}

.player-title {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.player-points {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

/* Roster slot */
.roster-slot {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.roster-slot:last-child {
    border-bottom: none;
}

.roster-slot .slot-label {
    width: 4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.roster-slot.bench {
    background: rgba(0,0,0,0.2);
}

.roster-slot.empty {
    opacity: 0.5;
}

/* Matchup card */
.matchup-card {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    color: var(--text-primary);
}

.matchup-card:hover {
    color: var(--text-primary);
}

.matchup-team {
    text-align: center;
}

.matchup-team.left {
    text-align: right;
}

.matchup-team.right {
    text-align: left;
}

.matchup-score {
    font-size: 2rem;
    font-weight: 700;
}

.matchup-vs {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Draft board */
.draft-board {
    display: grid;
    gap: 0.5rem;
}

.draft-pick {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-input);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.draft-pick-number {
    font-weight: 700;
    color: var(--text-muted);
    min-width: 2rem;
}

.draft-pick.current {
    background: var(--primary);
    border: 2px solid var(--accent);
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.2s;
}

.modal-backdrop.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Loading spinner */
.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--bg-input);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Week selector */
.week-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.week-selector button {
    background: var(--bg-input);
    border: none;
    color: var(--text-primary);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.week-selector button:hover {
    background: var(--primary-light);
}

.week-selector span {
    min-width: 5rem;
    text-align: center;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .navbar-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }

    .matchup-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .matchup-team.left,
    .matchup-team.right {
        text-align: center;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-input);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Chat Widget */
.chat-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 300px;
    max-height: 400px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
}

.chat-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2);
}

.chat-header h4 {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 2rem 1rem;
}

.chat-message {
    max-width: 85%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius);
    border-top-left-radius: 4px;
}

.chat-message.own {
    margin-left: auto;
    background: var(--primary);
    border-top-left-radius: var(--radius);
    border-top-right-radius: 4px;
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.chat-author {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

.chat-message.own .chat-author {
    color: var(--accent-light);
}

.chat-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.chat-message-body {
    font-size: 0.875rem;
    color: var(--text-primary);
    word-wrap: break-word;
}

.chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.1);
}

.chat-input input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background: var(--bg-input);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: var(--text-primary);
}

.chat-input input:focus {
    outline: none;
    border-color: var(--accent);
}

.chat-input input::placeholder {
    color: var(--text-muted);
}

/* Flex-1 utility */
.flex-1 {
    flex: 1;
}
