/* Football Pool - Red, White & Black Theme */

:root {
    --primary-red: #DC143C;
    --dark-red: #A01020;
    --light-red: #FF4D6D;
    --black: #1a1a1a;
    --dark-gray: #2d2d2d;
    --medium-gray: #4a4a4a;
    --light-gray: #e0e0e0;
    --white: #ffffff;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 100%);
    color: var(--white);
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: var(--black);
    border-bottom: 3px solid var(--primary-red);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left h1 {
    color: var(--white);
    font-size: 1.5rem;
}

.nav-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-right span {
    color: var(--light-gray);
}

.back-link {
    color: var(--light-red);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--white);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: var(--dark-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 20, 60, 0.3);
}

.btn-secondary {
    background: var(--medium-gray);
    color: var(--white);
}

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

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

.btn-admin:hover {
    background: #e0a800;
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--primary-red);
}

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

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

.btn-danger:hover {
    background: #c82333;
}

.btn-disabled {
    background: var(--medium-gray);
    color: var(--light-gray);
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    color: var(--white);
    font-size: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    border: 2px solid var(--success);
    color: #90ee90;
}

.alert-error {
    background: rgba(220, 53, 69, 0.2);
    border: 2px solid var(--danger);
    color: #ff6b6b;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.game-card {
    background: var(--dark-gray);
    border: 2px solid var(--medium-gray);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(220, 20, 60, 0.3);
    border-color: var(--primary-red);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.game-header h3 {
    color: var(--white);
    font-size: 1.3rem;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-setup {
    background: var(--medium-gray);
    color: var(--light-gray);
}

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

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

.status-in_progress {
    background: var(--primary-red);
    color: var(--white);
    animation: pulse 2s infinite;
}

.status-completed {
    background: var(--dark-gray);
    color: var(--white);
    border: 2px solid var(--success);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.game-matchup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--black);
    border-radius: 8px;
}

.game-matchup .team {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--light-red);
}

.game-matchup .vs {
    color: var(--light-gray);
    font-weight: 600;
}

.game-info {
    margin: 1rem 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--medium-gray);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: var(--light-gray);
}

.info-row .value {
    color: var(--white);
    font-weight: 600;
}

.game-payouts {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(220, 20, 60, 0.1);
    border-radius: 8px;
}

.game-payouts h4 {
    color: var(--light-red);
    margin-bottom: 0.5rem;
}

.payout-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.payout-grid > div {
    padding: 0.4rem;
    background: var(--dark-gray);
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

.payout-special {
    grid-column: 1 / -1;
    background: var(--primary-red) !important;
    color: var(--white);
    font-weight: 700;
}

.game-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.game-actions .btn {
    flex: 1;
    text-align: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--dark-gray);
    border-radius: 10px;
    border: 2px dashed var(--medium-gray);
}

.empty-state p {
    color: var(--light-gray);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-box {
    background: var(--dark-gray);
    border: 3px solid var(--primary-red);
    border-radius: 15px;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.login-box h1 {
    text-align: center;
    color: var(--white);
    margin-bottom: 2rem;
    font-size: 2rem;
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    padding: 0.8rem;
    background: var(--medium-gray);
    border: none;
    color: var(--light-gray);
    font-weight: 600;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--light-gray);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--black);
    border: 2px solid var(--medium-gray);
    border-radius: 5px;
    color: var(--white);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-red);
}

/* Grid Page */
.grid-container {
    max-width: 100%;
    padding: 2rem;
}

.grid-header {
    text-align: center;
    margin-bottom: 2rem;
}

.grid-header h1 {
    color: var(--white);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.matchup {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    font-size: 1.5rem;
    margin: 1rem 0;
}

.matchup .team {
    color: var(--light-red);
    font-weight: 700;
}

.matchup .vs {
    color: var(--light-gray);
}

.game-date {
    color: var(--light-gray);
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

/* Winners Section */
.winners-section {
    background: var(--dark-gray);
    border: 2px solid var(--primary-red);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.winners-section h3 {
    color: var(--white);
    margin-bottom: 1.5rem;
    text-align: center;
}

.winners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.winner-card {
    background: var(--black);
    border: 2px solid var(--primary-red);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.winner-quarter {
    color: var(--light-red);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.winner-name {
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.winner-score {
    color: var(--light-gray);
    margin: 0.5rem 0;
}

.winner-payout {
    color: var(--success);
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

/* Scores Section */
.scores-section {
    background: var(--dark-gray);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.scores-section h3 {
    color: var(--white);
    margin-bottom: 1.5rem;
    text-align: center;
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.score-card {
    background: var(--black);
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.score-card .quarter {
    color: var(--primary-red);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.score-card .score {
    color: var(--white);
    font-size: 0.95rem;
    margin: 0.3rem 0;
}

/* Grid Board */
.grid-wrapper {
    background: var(--dark-gray);
    border: 3px solid var(--primary-red);
    border-radius: 15px;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.grid-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-square {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 2px solid var(--medium-gray);
}

.legend-square.available {
    background: var(--black);
}

.legend-square.claimed {
    background: var(--medium-gray);
}

.legend-square.mine {
    background: var(--primary-red);
}

.legend-note {
    color: var(--success);
    font-weight: 700;
}

.grid-board {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.grid-axis-top {
    display: flex;
    align-items: center;
    margin-left: 60px;
}

.axis-label {
    writing-mode: horizontal-tb;
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    text-align: center;
    width: 100%;
}

.axis-label-vertical {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    width: 60px;
}

.axis-numbers {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    width: 100%;
}

.axis-numbers-vertical {
    display: grid;
    grid-template-rows: repeat(10, 1fr);
    gap: 4px;
    height: 100%;
}

.axis-number {
    background: var(--primary-red);
    color: var(--white);
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    aspect-ratio: 1;
}

.grid-main {
    display: flex;
    gap: 0.5rem;
}

.grid-axis-left {
    display: flex;
    align-items: stretch;
}

.grid-squares {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 4px;
    flex: 1;
    aspect-ratio: 1;
}

.square {
    background: var(--black);
    border: 2px solid var(--medium-gray);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    position: relative;
}

.square.available:hover {
    background: rgba(220, 20, 60, 0.2);
    border-color: var(--primary-red);
    transform: scale(1.05);
}

.square.claimed {
    background: var(--medium-gray);
    cursor: default;
}

.square.mine {
    background: var(--primary-red);
    border-color: var(--white);
    cursor: default;
}

.square-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.square-name {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--white);
    text-align: center;
    padding: 2px;
    word-wrap: break-word;
    line-height: 1.1;
}

/* Profile Page */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-card {
    background: var(--dark-gray);
    border: 2px solid var(--medium-gray);
    border-radius: 10px;
    padding: 2rem;
}

.profile-card h3 {
    color: var(--white);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 0.5rem;
}

.help-text {
    color: var(--light-gray);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.profile-image-container {
    text-align: center;
    margin: 1.5rem 0;
}

.profile-image-preview {
    width: 200px;
    height: 200px;
    border: 3px solid var(--primary-red);
    border-radius: 8px;
    object-fit: cover;
}

.no-image {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border: 3px dashed var(--medium-gray);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--light-gray);
}

.upload-form {
    margin-top: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-box {
    background: var(--black);
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.stat-box.highlight {
    border-color: var(--primary-red);
    background: rgba(220, 20, 60, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--light-gray);
    font-size: 0.9rem;
}

.winnings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.winnings-table th,
.winnings-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
}

.winnings-table th {
    background: var(--black);
    color: var(--light-red);
    font-weight: 700;
}

.winnings-table td {
    color: var(--white);
}

/* Admin Panel */
.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-tab-content {
    display: none;
    background: var(--dark-gray);
    border: 2px solid var(--medium-gray);
    border-radius: 10px;
    padding: 2rem;
}

.admin-tab-content.active {
    display: block;
}

.admin-tab-content h2 {
    color: var(--white);
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 0.5rem;
}

.admin-form {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--black);
    border-radius: 8px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
}

.admin-table th {
    background: var(--primary-red);
    color: var(--white);
    font-weight: 700;
}

.admin-table td {
    color: var(--white);
}

.admin-table tr:hover {
    background: var(--dark-gray);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .grid-squares {
        gap: 3px;
    }
    
    .axis-number {
        font-size: 1rem;
    }
    
    .square-name {
        font-size: 0.6rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-wrapper {
        padding: 1rem;
    }
    
    .grid-squares {
        gap: 2px;
    }
    
    .square {
        border-width: 1px;
    }
    
    .axis-label-vertical {
        font-size: 0.9rem;
        width: 40px;
    }
    
    .grid-axis-top {
        margin-left: 40px;
    }
    
    .axis-number {
        font-size: 0.8rem;
    }
    
    .square-name {
        font-size: 0.5rem;
    }
    
    .matchup {
        font-size: 1.2rem;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .grid-container {
        padding: 1rem;
    }
    
    .grid-header h1 {
        font-size: 1.8rem;
    }
    
    .matchup .team {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}
