/**
 * Valhalla Bets Styles
 * Dark Viking theme with gold accents matching Build Library Manager
 */

/* ==================== Container & Layout ==================== */
.valhalla-bets-wrapper {
    max-width: none;
    margin: 0 auto;
    padding: 20px;
    background: rgba(20, 20, 25, 0.95);
    border-radius: 12px;
    border: 2px solid #8b7355;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #f5f5dc;
}

/* ==================== Header ==================== */
.valhalla-bets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.3) 0%, rgba(20, 20, 25, 0.9) 100%);
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #8b7355;
}

.valhalla-bets-header h1 {
    margin: 0;
    color: #ffd700;
    font-size: 1.8em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.header-info {
    display: flex;
    gap: 15px;
}

.user-badge, .role-badge {
    background: rgba(139, 115, 85, 0.5);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    border: 1px solid #8b7355;
}

.staff-badge {
    background: linear-gradient(135deg, #8b7355 0%, #d4af37 100%);
    color: #1a1a1a;
    font-weight: bold;
}

.player-badge {
    background: rgba(139, 115, 85, 0.5);
    color: #f5f5dc;
}

/* ==================== Tabs ==================== */
.valhalla-bets-tabs {
    display: flex;
    gap: 5px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 12px 24px;
    background: rgba(139, 115, 85, 0.3);
    border: 1px solid #8b7355;
    border-radius: 6px;
    color: #f5f5dc;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: rgba(139, 115, 85, 0.5);
}

.tab-button.active {
    background: linear-gradient(135deg, #8b7355 0%, #d4af37 100%);
    color: #1a1a1a;
    font-weight: bold;
}

/* ==================== Tab Content ==================== */
.tab-content {
    display: none;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(139, 115, 85, 0.3);
}

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

.tab-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.5);
}

.tab-header h2 {
    margin: 0 0 10px 0;
    color: #ffd700;
}

.tab-header p {
    margin: 0;
    color: #a0a0a0;
}

/* ==================== Buttons ==================== */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #8b7355 0%, #d4af37 100%);
    color: #1a1a1a;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
}

.btn-secondary {
    background: rgba(139, 115, 85, 0.3);
    color: #f5f5dc;
    border: 1px solid #8b7355;
}

.btn-secondary:hover {
    background: rgba(139, 115, 85, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #dc3545 100%);
}

/* ==================== Forms ==================== */
.event-form-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #8b7355;
}

.event-form-container h3 {
    margin: 0 0 20px 0;
    color: #ffd700;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    color: #a0a0a0;
    font-size: 0.9em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #8b7355;
    border-radius: 6px;
    color: #f5f5dc;
    font-size: 1em;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ==================== Fighter Section ==================== */
.fighter-section {
    background: rgba(139, 115, 85, 0.1);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid rgba(139, 115, 85, 0.3);
}

.fighter-section h4 {
    margin: 0 0 15px 0;
    color: #d4af37;
}

.fighter-search-group {
    position: relative;
}

.player-search-wrapper {
    position: relative;
}

/* ==================== Events List ==================== */
.events-list-container {
    margin-bottom: 30px;
}

.events-list-container h3 {
    margin: 0 0 15px 0;
    color: #ffd700;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.event-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #8b7355;
    transition: all 0.3s ease;
}

.event-card:hover {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.event-name {
    font-size: 1.2em;
    color: #ffd700;
    font-weight: bold;
}

.event-type-badge {
    background: rgba(139, 115, 85, 0.5);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    border: 1px solid #8b7355;
}

.event-type-badge.pvp {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
}

.event-type-badge.pve {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
}

.event-fighters {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
}

.fighter-info {
    background: rgba(139, 115, 85, 0.2);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid rgba(139, 115, 85, 0.3);
}

.fighter-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #d4af37;
    margin-bottom: 8px;
}

.fighter-odds {
    display: flex;
    gap: 10px;
    font-size: 0.9em;
    color: #a0a0a0;
}

.vs-divider {
    font-size: 1.5em;
    color: #ffd700;
    font-weight: bold;
    text-align: center;
}

.event-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.event-meta {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    font-size: 0.85em;
    color: #a0a0a0;
}

/* ==================== Bets List ==================== */
.bets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bet-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid transparent;
}

.bet-card.pending {
    border-left-color: #ffc107;
}

.bet-card.active {
    border-left-color: #17a2b8;
}

.bet-card.won {
    border-left-color: #28a745;
}

.bet-card.lost {
    border-left-color: #dc3545;
}

.bet-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.bet-event-name {
    font-weight: bold;
    color: #ffd700;
}

.bet-status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.bet-status-badge.pending {
    background: #ffc107;
    color: #1a1a1a;
}

.bet-status-badge.active {
    background: #17a2b8;
    color: #fff;
}

.bet-status-badge.won {
    background: #28a745;
    color: #fff;
}

.bet-status-badge.lost {
    background: #dc3545;
    color: #fff;
}

.bet-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    font-size: 0.9em;
}

.bet-detail-item {
    display: flex;
    flex-direction: column;
}

.bet-detail-label {
    color: #a0a0a0;
    font-size: 0.85em;
    margin-bottom: 2px;
}

.bet-detail-value {
    color: #f5f5dc;
    font-weight: 500;
}

.bet-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* ==================== Summary Cards ==================== */
.bets-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.summary-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #8b7355;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-label {
    color: #a0a0a0;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.summary-value {
    color: #ffd700;
    font-size: 1.8em;
    font-weight: bold;
}

/* ==================== History List ==================== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #8b7355;
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-event-name {
    font-size: 1.2em;
    color: #ffd700;
    font-weight: bold;
}

.history-date {
    color: #a0a0a0;
    font-size: 0.85em;
}

.history-result {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
}

.result-fighter {
    background: rgba(139, 115, 85, 0.2);
    padding: 15px;
    border-radius: 6px;
}

.result-fighter.winner {
    border: 2px solid #28a745;
}

.result-fighter.loser {
    border: 2px solid #dc3545;
    opacity: 0.6;
}

.result-fighter-name {
    font-weight: bold;
    color: #d4af37;
    margin-bottom: 5px;
}

.result-stats {
    font-size: 0.9em;
    color: #a0a0a0;
}

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

.modal-content {
    background: rgba(20, 20, 25, 0.98);
    border: 2px solid #8b7355;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.modal-close {
    background: none;
    border: none;
    color: #f5f5dc;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #ffd700;
}

.modal-body {
    padding: 20px;
}

.event-details {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #8b7355;
}

.bet-calculation {
    background: rgba(139, 115, 85, 0.1);
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border: 1px solid rgba(139, 115, 85, 0.3);
}

.calc-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.calc-row:last-child {
    margin-bottom: 0;
}

.payout-value {
    color: #28a745;
    font-weight: bold;
}

.loss-value {
    color: #dc3545;
    font-weight: bold;
}

.bet-warning {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid #ffc107;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    color: #ffd700;
}

/* ==================== Loading Spinner ==================== */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #a0a0a0;
    font-style: italic;
}

.loading-spinner::before {
    content: "⚔️ ";
    animation: spin 2s linear infinite;
    display: inline-block;
}

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

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #a0a0a0;
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 1.1em;
}

/* ==================== Placeholder Text ==================== */
.placeholder-text {
    color: #a0a0a0;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ==================== Bookie Actions ==================== */
.bookie-actions {
    margin-bottom: 20px;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .valhalla-bets-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-info {
        width: 100%;
        justify-content: center;
    }
    
    .event-fighters {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .vs-divider {
        transform: rotate(90deg);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .bets-summary {
        grid-template-columns: 1fr 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .valhalla-bets-wrapper {
        padding: 10px;
    }
    
    .valhalla-bets-header h1 {
        font-size: 1.4em;
    }
    
    .bets-summary {
        grid-template-columns: 1fr;
    }
    
    .event-actions {
        flex-direction: column;
    }
    
    .event-actions .btn {
        width: 100%;
    }
}

/* ==================== Toggle Switch (for deposit confirmation) ==================== */
.deposit-toggle-group {
    background: rgba(139, 115, 85, 0.1);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid rgba(139, 115, 85, 0.3);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(139, 115, 85, 0.3);
    border-radius: 13px;
    border: 1px solid #8b7355;
    transition: background 0.3s ease;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #f5f5dc;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch {
    background: linear-gradient(135deg, #8b7355 0%, #ffd700 100%);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch::before {
    transform: translateX(24px);
}

.toggle-text {
    font-weight: 500;
    color: #f5f5dc;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #a0a0a0;
    font-style: italic;
}

.staff-only-field {
    background: rgba(255, 215, 0, 0.05);
    border-left: 3px solid #ffd700;
    padding-left: 15px;
}
