/* MuffinMan POC - Styles */

:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --secondary: #ed8936;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ecc94b;
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
    --gray-400: #cbd5e0;
    --gray-500: #a0aec0;
    --gray-600: #718096;
    --gray-700: #4a5568;
    --gray-800: #2d3748;
    --white: #ffffff;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
}

/* Layout */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--primary);
    color: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    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 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.75rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 500;
}

main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    width: 100%;
}

/* Navigation */
nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
    padding: 0 1rem;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.nav-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-btn:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.nav-btn.active {
    color: var(--primary);
    border-bottom-color: var(--secondary);
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background: #dd6b20;
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-outline {
    background: var(--white);
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.1rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.form-input-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.9rem;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h1 {
    font-size: 2rem;
    color: var(--primary);
}

.login-logo p {
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.login-error {
    background: #fed7d7;
    color: #c53030;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.login-hint {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.login-hint code {
    background: var(--gray-200);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: monospace;
}

/* Week Selector */
.week-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.week-selector label {
    font-weight: 600;
    color: var(--gray-700);
}

.week-selector select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--white);
    cursor: pointer;
}

/* Games List */
.games-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.game-card.locked {
    opacity: 0.7;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.85rem;
    color: var(--gray-600);
}

.game-time {
    font-weight: 500;
}

.game-status {
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.game-status.locked {
    background: var(--gray-300);
    color: var(--gray-700);
}

.game-status.open {
    background: #c6f6d5;
    color: #276749;
}

.game-status.final {
    background: var(--primary);
    color: var(--white);
}

.game-body {
    padding: 1rem;
}

.game-matchup {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.team:hover:not(.disabled) {
    background: var(--gray-100);
}

.team.selected {
    background: #ebf8ff;
    border-color: var(--primary);
}

.team.winner {
    background: #c6f6d5;
}

.team.loser {
    background: #fed7d7;
}

.team.push {
    background: #fefcbf;
}

.team.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.team-abbrev {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.team-name {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.team-spread {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary);
    margin-top: 0.375rem;
}

.team-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-top: 0.25rem;
}

.vs-divider {
    font-size: 0.85rem;
    color: var(--gray-400);
    font-weight: 500;
}

/* Picks Summary */
.picks-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.picks-count {
    font-size: 1.1rem;
}

.picks-count strong {
    color: var(--primary);
}

/* Standings Table */
.standings-table {
    width: 100%;
    border-collapse: collapse;
}

.standings-table th,
.standings-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.standings-table th {
    background: var(--gray-100);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--gray-600);
}

.standings-table tr:hover {
    background: var(--gray-50);
}

.standings-table .rank {
    font-weight: 700;
    color: var(--primary);
    width: 50px;
}

.standings-table .points {
    font-weight: 700;
    color: var(--secondary);
}

.standings-table .current-user {
    background: #ebf8ff;
}

/* Admin Styles */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.admin-game {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.admin-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.admin-game-teams {
    font-weight: 600;
    color: var(--gray-800);
}

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.admin-form-row.single {
    grid-template-columns: 1fr;
}

/* Weekly Picks Display */
.weekly-picks {
    margin-top: 2rem;
}

.weekly-picks h3 {
    margin-bottom: 1rem;
    color: var(--gray-700);
}

.user-picks-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    overflow: hidden;
}

.user-picks-header {
    padding: 0.875rem 1rem;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
}

.user-picks-body {
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pick-chip {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--gray-200);
    color: var(--gray-700);
}

.pick-chip.win {
    background: #c6f6d5;
    color: #276749;
}

.pick-chip.loss {
    background: #fed7d7;
    color: #c53030;
}

.pick-chip.push {
    background: #fefcbf;
    color: #975a16;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #c6f6d5;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.alert-error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert-info {
    background: #bee3f8;
    color: #2b6cb0;
    border: 1px solid #90cdf4;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--gray-300);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--secondary);
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--gray-500);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .nav-content {
        justify-content: center;
    }

    .nav-btn {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }

    main {
        padding: 1rem;
    }

    .game-matchup {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .vs-divider {
        padding: 0.25rem 0;
    }

    .team {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        padding: 0.875rem 1rem;
    }

    .team-info {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .team-spread {
        margin-top: 0;
        font-size: 1.1rem;
    }

    .picks-summary {
        flex-direction: column;
        text-align: center;
    }

    .standings-table {
        font-size: 0.9rem;
    }

    .standings-table th,
    .standings-table td {
        padding: 0.625rem 0.5rem;
    }

    .admin-form-row {
        grid-template-columns: 1fr;
    }

    .week-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .week-selector select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }

    .team-abbrev {
        font-size: 1.25rem;
    }

    .btn {
        width: 100%;
    }

    .tabs {
        overflow-x: auto;
    }

    .tab-btn {
        flex-shrink: 0;
    }
}
