/* Betting Page Styles */

.betting-page {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.betting-container {
    min-height: 100vh;
    padding-top: 80px; /* Add space for fixed navbar */
}

/* Override container max-width for betting page to use more space */
.betting-page .container {
    max-width: 1600px;
}

/* Header */
.betting-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.betting-header h1 {
    color: #2d3748;
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.betting-header p {
    color: #4a5568;
    font-size: 1.2rem;
    margin: 0;
}

/* Tournament Info */
.tournament-info {
    padding: 2rem 0;
}

.info-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.info-card h2 {
    color: #2d3748;
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
}

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

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.info-label {
    font-weight: 600;
    color: #4a5568;
}

.info-value {
    color: #2d3748;
    font-weight: 500;
}

/* Main Content Layout */
.betting-main {
    padding: 2rem 0;
}

.betting-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

/* Better responsive layout for larger screens */
@media (min-width: 1400px) {
    .betting-content {
        grid-template-columns: 1fr 400px;
        gap: 3rem;
    }
}

/* Ensure all sections on betting page use same width */
.betting-page .tournament-info .container,
.betting-page .betting-main .container {
    max-width: 1600px;
    width: 100%;
}

/* Pairings Section */
.pairings-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.pairings-section h2 {
    color: #2d3748;
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
}

.pairings-section p {
    color: #4a5568;
    margin: 0 0 2rem 0;
}

.day-section {
    margin-bottom: 2rem;
}

.day-section h3 {
    color: #2d3748;
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

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

/* Match Card */
.match-card {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.match-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

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

.match-number {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.match-type {
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
}

.match-teams {
    margin-bottom: 1rem;
}

.team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.team-name {
    font-weight: 600;
    color: #2d3748;
}

.team-players {
    color: #4a5568;
    font-size: 0.9rem;
}

.bet-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Bet buttons container */
.bet-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.bet-btn {
    padding: 0.6rem 1rem;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    flex: 0 0 calc(50% - 0.25rem); /* Two buttons per row with gap */
    min-width: 0; /* Allow shrinking */
}

.bet-btn:hover {
    background: #667eea;
    color: white;
}

.bet-btn.selected {
    background: #667eea;
    color: white;
}

.bet-btn.selected:hover {
    background: #5a67d8;
}

/* Bet Slip Sidebar */
.bet-slip-sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.bet-slip-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bet-slip-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.3rem;
}

.btn-clear {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-clear:hover {
    background: #c53030;
}

.bet-slip-content {
    padding: 1.5rem;
}

.selected-bets {
    margin-bottom: 1.5rem;
}

.no-bets {
    color: #4a5568;
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
}

.bet-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.bet-item:last-child {
    margin-bottom: 0;
}

.bet-match {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.bet-team {
    color: #4a5568;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.bet-amount {
    color: #667eea;
    font-weight: 600;
}

.bet-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bet-remove:hover {
    background: #c53030;
}

.bet-slip-total {
    background: #667eea;
    color: white;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 600;
}

.bet-slip-form h4 {
    color: #2d3748;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

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

.form-group label {
    display: block;
    color: #4a5568;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-submit:hover:not(:disabled) {
    background: #38a169;
}

.btn-submit:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #2d3748;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #4a5568;
}

.modal-body {
    padding: 1.5rem;
}

.betslip-info {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.betslip-info h3 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
}

.payment-section h3 {
    color: #2d3748;
    margin: 0 0 1rem 0;
}

.payment-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.payment-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.payment-btn:hover {
    transform: translateY(-2px);
}

.venmo-btn {
    background: #3d95ce;
    color: white;
}

.paypal-btn {
    background: #0070ba;
    color: white;
}

.payment-note {
    background: #fff5cd;
    border: 1px solid #f6e05e;
    padding: 1rem;
    border-radius: 6px;
}

.payment-note code {
    background: #2d3748;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    display: block;
    margin-top: 0.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    text-align: right;
}

.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-primary:hover {
    background: #5a67d8;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .betting-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .bet-slip-sidebar {
        position: static;
        max-height: none;
    }
    
    .betting-header h1 {
        font-size: 2rem;
    }
    
    .betting-header p {
        font-size: 1rem;
    }
    
    .matches-grid {
        grid-template-columns: 1fr;
    }
    
    .payment-buttons {
        flex-direction: column;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    /* Smaller buttons on mobile */
    .bet-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .betting-header {
        padding: 1rem 0;
    }
    
    .betting-header h1 {
        font-size: 1.5rem;
    }
    
    .pairings-section,
    .bet-slip-content {
        padding: 1rem;
    }
    
    .modal-content {
        width: 95%;
    }
}
