/* EV Calculator WordPress Plugin Styles */
.ev-calculator-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8fafc;
    min-height: 400px;
}

.ev-calculator-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Header Styles */
.ev-calculator-header {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    padding: 32px 24px;
    color: white;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.header-icon {
    font-size: 32px;
}

.ev-calculator-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: white;
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 16px;
}

/* Content Styles */
.ev-calculator-content {
    padding: 24px;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Section Styles */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
}

/* Input Styles */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.input-field:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Odds Formats */
.odds-formats {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
}

.formats-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 12px 0;
}

.formats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.format-item {
    text-align: center;
}

.format-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.format-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

/* Results Section */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* EV Result Card */
.ev-result-card {
    border-radius: 8px;
    padding: 24px;
    border: 2px solid;
    transition: all 0.3s ease;
}

.ev-result-card.positive-ev {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.ev-result-card.negative-ev {
    background: #fef2f2;
    border-color: #fecaca;
}

.ev-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ev-icon {
    font-size: 24px;
}

.ev-label {
    font-size: 18px;
    font-weight: 700;
}

.positive-ev .ev-label {
    color: #059669;
}

.negative-ev .ev-label {
    color: #dc2626;
}

.ev-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ev-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ev-value {
    font-size: 20px;
    font-weight: 700;
}

.positive-ev .ev-value {
    color: #059669;
}

.negative-ev .ev-value {
    color: #dc2626;
}

.ev-value-small {
    font-weight: 600;
}

.positive-ev .ev-value-small {
    color: #059669;
}

.negative-ev .ev-value-small {
    color: #dc2626;
}

/* Bet Analysis */
.bet-analysis {
    background: #eff6ff;
    border-radius: 8px;
    padding: 16px;
}

.analysis-title {
    font-size: 14px;
    font-weight: 500;
    color: #1e40af;
    margin: 0 0 12px 0;
}

.analysis-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analysis-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #1e40af;
}

.analysis-value {
    font-weight: 600;
}

/* Formula Explanation */
.formula-explanation {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
}

.formula-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 8px 0;
}

.formula-text {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.formula-calculation {
    font-size: 11px;
    color: #9ca3af;
    font-family: 'Courier New', monospace;
    margin: 0;
}

/* Loading Styles */
.ev-calculator-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.ev-calculator-loading p {
    margin: 0;
    font-size: 16px;
}

/* WordPress Admin Styles */
.wrap .card {
    margin-bottom: 20px;
}

.wrap .card h2 {
    margin-top: 0;
}

.wrap .card h3 {
    margin-bottom: 10px;
}

.wrap .card ul {
    margin-left: 20px;
}

.wrap .card code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Responsive Design */
@media (max-width: 640px) {
    .ev-calculator-wrapper {
        padding: 16px;
    }
    
    .ev-calculator-header {
        padding: 24px 16px;
    }
    
    .ev-calculator-header h1 {
        font-size: 24px;
    }
    
    .ev-calculator-content {
        padding: 16px;
    }
    
    .formats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .format-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .format-label {
        margin-bottom: 0;
    }
}

/* Ensure proper box-sizing */
.ev-calculator-wrapper *,
.ev-calculator-wrapper *::before,
.ev-calculator-wrapper *::after {
    box-sizing: border-box;
}

/* Hide loading state once initialized */
[data-initialized="true"] .ev-calculator-loading {
    display: none;
}