/**
 * Bet Builder Modal Styles
 */

/* Modal Overlay */
.bet-builder-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.bet-builder-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.bet-builder-modal {
    background: linear-gradient(180deg, #1a2744 0%, #0f172a 100%);
    border-radius: 20px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.bet-builder-overlay.active .bet-builder-modal {
    transform: scale(1) translateY(0);
}

/* Header */
.bet-builder-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.bet-builder-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bet-builder-header h2 i {
    font-size: 1.5rem;
}

.bet-builder-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.bet-builder-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Match Info */
.bet-builder-match {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.bet-builder-teams {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f1f5f9;
}

.bet-builder-teams .vs {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 400;
}

.bet-builder-meta {
    text-align: center;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Markets Container */
.bet-builder-markets {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Individual Market */
.bet-builder-market {
    margin-bottom: 24px;
}

.bet-builder-market:last-child {
    margin-bottom: 0;
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.market-name {
    font-size: 1rem;
    font-weight: 600;
    color: #f1f5f9;
}

.market-description {
    font-size: 0.8rem;
    color: #64748b;
}

/* Market Options */
.market-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.market-option {
    flex: 1;
    min-width: calc(33.333% - 8px);
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.market-option:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.market-option.selected {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
}

.market-option .option-label {
    font-size: 0.85rem;
    color: #e2e8f0;
    font-weight: 500;
    margin-bottom: 4px;
}

.market-option .option-odd {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fbbf24;
}

.market-option.selected .option-odd {
    color: #22c55e;
}

/* Over/Under specific styling */
.market-options.over-under {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.market-options.over-under .market-option {
    min-width: unset;
}

/* Footer / Bet Slip */
.bet-builder-footer {
    background: #1e293b;
    border-top: 1px solid #334155;
    padding: 20px 24px;
    flex-shrink: 0;
}

.selections-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.selections-count {
    font-size: 0.9rem;
    color: #94a3b8;
}

.selections-count span {
    color: #3b82f6;
    font-weight: 600;
}

.combined-odds {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fbbf24;
}

.combined-odds-label {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 400;
    margin-right: 8px;
}

/* Stake Input */
.stake-input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.stake-input-wrapper {
    flex: 1;
    position: relative;
}

.stake-input-wrapper .currency-symbol {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-weight: 600;
}

.stake-input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 32px;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.stake-input-wrapper input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Quick Stakes */
.quick-stakes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-stake {
    background: #334155;
    border: none;
    color: #e2e8f0;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.quick-stake:hover {
    background: #3b82f6;
}

/* Potential Return */
.potential-return {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 10px;
    margin-bottom: 16px;
}

.potential-return-label {
    color: #94a3b8;
    font-size: 0.9rem;
}

.potential-return-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #22c55e;
}

/* Place Bet Button */
.place-bet-builder-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.place-bet-builder-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.3);
}

.place-bet-builder-btn:disabled {
    background: #334155;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Selected Items Preview */
.selections-preview {
    margin-bottom: 16px;
    max-height: 120px;
    overflow-y: auto;
}

.selection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.selection-item:last-child {
    margin-bottom: 0;
}

.selection-item .selection-name {
    color: #e2e8f0;
}

.selection-item .selection-odd {
    color: #fbbf24;
    font-weight: 600;
}

.selection-item .remove-selection {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
}

/* Loading State */
.bet-builder-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.bet-builder-loading i {
    font-size: 3rem;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Error State */
.bet-builder-error {
    text-align: center;
    padding: 40px 20px;
    color: #ef4444;
}

.bet-builder-error i {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* Minimum Selection Warning */
.min-selection-warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    text-align: center;
    color: #fbbf24;
    font-size: 0.9rem;
}

/* Bet Builder Button (on fixture cards) */
.bet-builder-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.bet-builder-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.bet-builder-btn i {
    font-size: 0.75rem;
}

/* Desktop event actions container */
.desktop-event-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.desktop-event-actions .bet-builder-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
}

.desktop-event-actions .bet-builder-btn i {
    font-size: 0.85rem;
}

/* Mobile bet builder button styling */
.event-row-meta .bet-builder-btn {
    margin-left: auto;
    padding: 4px 10px;
    font-size: 0.7rem;
}

.event-row-meta .bet-builder-btn .bb-text {
    display: none;
}

@media (min-width: 400px) {
    .event-row-meta .bet-builder-btn .bb-text {
        display: inline;
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .bet-builder-modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    /* Compact header */
    .bet-builder-header {
        padding: 10px 14px;
    }
    
    .bet-builder-header h2 {
        font-size: 1rem;
    }
    
    .bet-builder-header h2 i {
        font-size: 1.1rem;
    }
    
    .bet-builder-close {
        width: 30px;
        height: 30px;
    }
    
    /* Compact match info */
    .bet-builder-match {
        padding: 10px 14px;
    }
    
    .bet-builder-teams {
        font-size: 0.9rem;
        gap: 10px;
    }
    
    .bet-builder-meta {
        font-size: 0.75rem;
        margin-top: 4px;
    }
    
    /* Compact markets area */
    .bet-builder-markets {
        padding: 12px 14px;
    }
    
    .bet-builder-market {
        margin-bottom: 16px;
    }
    
    .market-header {
        margin-bottom: 8px;
    }
    
    .market-name {
        font-size: 0.85rem;
    }
    
    .market-description {
        font-size: 0.7rem;
        display: none; /* Hide description on mobile to save space */
    }
    
    .market-options {
        gap: 6px;
    }
    
    .market-option {
        min-width: calc(50% - 4px);
        padding: 8px 6px;
        border-radius: 8px;
    }
    
    .market-option .option-label {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }
    
    .market-option .option-odd {
        font-size: 0.9rem;
    }
    
    .market-options.over-under {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    /* Compact footer - This is the key area to shrink */
    .bet-builder-footer {
        padding: 10px 14px;
    }
    
    .selections-summary {
        margin-bottom: 8px;
    }
    
    .selections-count {
        font-size: 0.75rem;
    }
    
    .combined-odds {
        font-size: 1rem;
    }
    
    .combined-odds-label {
        font-size: 0.7rem;
    }
    
    /* Smaller selections preview */
    .selections-preview {
        margin-bottom: 8px;
        max-height: 60px;
    }
    
    .selection-item {
        padding: 4px 8px;
        font-size: 0.7rem;
        margin-bottom: 4px;
    }
    
    .min-selection-warning {
        padding: 6px 8px;
        margin-bottom: 8px;
        font-size: 0.75rem;
    }
    
    /* Compact stake row - horizontal on mobile */
    .stake-input-row {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .stake-input-wrapper {
        flex: 1;
    }
    
    .stake-input-wrapper input {
        padding: 10px 10px 10px 24px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .stake-input-wrapper .currency-symbol {
        left: 10px;
        font-size: 0.85rem;
    }
    
    .quick-stakes {
        display: flex;
        gap: 4px;
        flex-wrap: nowrap;
    }
    
    .quick-stake {
        padding: 8px 10px;
        font-size: 0.75rem;
        border-radius: 6px;
    }
    
    /* Compact potential return */
    .potential-return {
        padding: 8px 10px;
        margin-bottom: 8px;
        border-radius: 8px;
    }
    
    .potential-return-label {
        font-size: 0.75rem;
    }
    
    .potential-return-value {
        font-size: 1.1rem;
    }
    
    /* Smaller place bet button */
    .place-bet-builder-btn {
        padding: 12px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
}

/* Mobile bet builder button - full width below odds */
.mobile-bet-builder-row {
    width: 100%;
    padding: 6px 10px;
    margin-top: 8px;
}

.mobile-bet-builder-row .bet-builder-btn {
    width: 100%;
    justify-content: center;
    padding: 6px 10px;
    font-size: 0.7rem;
    border-radius: 6px;
}

.mobile-bet-builder-row .bet-builder-btn i {
    font-size: 0.7rem;
}

