/* Calculator VIG Styles */

/* Background shadow image styling - matches frontpage */
.shadow-img-1 {
    position: absolute;
    width: 100%;
    left: 0;
    z-index: -1;
}

.calculator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 15px 50px;
}

/* Add extra top margin for logged-in users (base_inside template) */
body:has(.sidebar) .calculator-container,
.calculator-container.logged-in {
    padding-top: 50px;
}

.calculator-header {
    text-align: center;
    margin-bottom: 60px;
}

.calculator-header h1 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 52px;
    line-height: 1.2;
    background: linear-gradient(107.9deg, #5499FF 5.16%, #0662ED 84.46%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.calculator-header p {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.6;
    color: #9B9B9B;
}

.calculator-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 50px;
}

.calculator-grid .calculator-card {
    max-width: 600px;
    width: 100%;
}

.calculator-card {
    background: linear-gradient(135deg, #1A1A1A 0%, #222831 100%);
    border: 1px solid #393939;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.calculator-card h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 28px;
    color: #FFFFFF;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #393939;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #9B9B9B;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bet-type-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.bet-type-option {
    position: relative;
}

.bet-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.bet-type-label {
    display: block;
    padding: 12px 24px;
    text-align: center;
    background: #0A0A0A;
    border: 1px solid #393939;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: #FFFFFF;
}

.bet-type-option input[type="radio"]:checked + .bet-type-label {
    background: linear-gradient(107.9deg, #5499FF 5.16%, #0662ED 84.46%);
    border-color: transparent;
    color: #FFFFFF;
    font-weight: 600;
}

.bet-type-label:hover {
    border-color: #5499FF;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: #0A0A0A;
    border: 1px solid #393939;
    border-radius: 8px;
    color: #FFFFFF;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.form-input:focus {
    outline: none;
    border-color: #5499FF;
    box-shadow: 0 0 0 3px rgba(84, 153, 255, 0.1);
}

.form-input::placeholder {
    color: #666666;
}

.calculate-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(107.9deg, #5499FF 5.16%, #0662ED 84.46%);
    border: none;
    border-radius: 8px;
    color: #FFFFFF;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(84, 153, 255, 0.4);
}

.result-container {
    margin-top: 30px;
    padding: 25px;
    background: #0A0A0A;
    border: 2px solid #393939;
    border-radius: 12px;
}

.result-container h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 24px;
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 20px;
}

.section-header {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: #FFFFFF;
    margin: 16px 0 6px;
    text-align: left;
}

.vig-highlight {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: rgba(6, 98, 237, 0.08);
    border: 2px solid rgba(84, 153, 255, 0.6);
    border-radius: 12px;
    box-shadow: 0 0 0 4px rgba(84, 153, 255, 0.08);
    margin-bottom: 14px;
}

.vig-label {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #9BCAFF;
}

.vig-value {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 28px;
    line-height: 1;
    color: #FFFFFF;
}

/* Divider variants: section vs inner */
.calculator-card hr.section-divider {
    border: 0;
    border-top: 2px solid #FFFFFF !important; /* dark mode default */
    margin: 18px 0;
}

.calculator-card hr.inner-divider {
    border: 0;
    border-top: 1px solid #393939;
    margin: 15px 0;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #B0B0B0;
}

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

.result-value {
    font-weight: 600;
    color: #FFFFFF;
}

.result-value.vig-positive {
    color: #5499FF;
    font-weight: 700;
}

.result-value.vig-negative {
    color: #00FF64;
    font-weight: 700;
}

.interpretation-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 15px;
    margin-top: 5px;
}

.interpretation-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.8;
    color: #B0B0B0;
    text-align: center;
    margin-bottom: 15px;
}

/* Light Mode Overrides (when using base_inside.html) */
html.light-mode .calculator-header p {
    color: #555555;
}

html.light-mode .calculator-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

html.light-mode .calculator-card h2 {
    color: #000000;
    border-bottom: 1px solid #eaeaea;
}

html.light-mode .bet-type-label {
    background: #ffffff;
    border: 1px solid #dddddd;
    color: #000000;
}

html.light-mode .bet-type-option input[type="radio"]:checked + .bet-type-label {
    color: #ffffff;
    border-color: transparent;
}

html.light-mode .form-input {
    background: #ffffff;
    border: 1px solid #dddddd;
    color: #000000;
}

html.light-mode .form-input::placeholder {
    color: #888888;
}

/* Results & interpretation */
html.light-mode .result-item {
    color: #333333;
}

html.light-mode .result-value {
    color: #000000;
}

html.light-mode .interpretation-title {
    color: #000000;
}

html.light-mode .interpretation-text {
    color: #333333;
}

/* Light mode: headers and dividers */
html.light-mode .section-header {
    color: #000000;
}

html.light-mode .calculator-card hr.section-divider {
    border-top-color: #000000 !important;
}

html.light-mode .calculator-card hr.inner-divider {
    border-top-color: #eaeaea;
}

/* Inline colored headers inside results */
html.light-mode #results-container h3 {
    color: #000000 !important;
}

/* Divider lines inside calculator card */
html.light-mode .calculator-card hr {
    border-color: #eaeaea !important;
}

.error-message {
    background: linear-gradient(135deg, rgba(255, 50, 50, 0.2) 0%, rgba(200, 0, 0, 0.1) 100%);
    border: 1px solid #FF3232;
    color: #FF3232;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    margin-top: 15px;
}

.text-positive {
    color: #00FF64;
    font-weight: 600;
}

.text-negative {
    color: #FF3232;
    font-weight: 600;
}

.text-warning {
    color: #FFA500;
    font-weight: 600;
}

.text-primary {
    color: #5499FF;
    font-weight: 600;
}

/* Grouped results: underline only first item in each group */
.result-group .result-item {
    border-bottom: none;
}
.result-group .result-item:first-child {
    border-bottom: 1px solid #393939;
}
html.light-mode .result-group .result-item:first-child {
    border-bottom-color: #eaeaea;
}
/* When a group has three items, add separator after the second item */
.result-group.has-three .result-item:nth-child(2) {
    border-bottom: 1px solid #393939;
}
html.light-mode .result-group.has-three .result-item:nth-child(2) {
    border-bottom-color: #eaeaea;
}

/* Responsive Design */
@media (max-width: 991px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-header h1 {
        font-size: 36px;
    }
    
    .calculator-card h2 {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .bet-type-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .bet-type-label {
        width: 100%;
    }

    /* Tablet: stack and center VIG highlight */
    .vig-highlight {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
    .vig-value {
        font-size: 32px;
        align-self: center;
    }
}

@media (max-width: 576px) {
    .calculator-header h1 {
        font-size: 28px;
    }
    
    .calculator-header p {
        font-size: 16px;
    }
    
    /* Reduce side spacing and let the card span nearly full width on mobile */
    .calculator-container {
        /* counter the outer .container padding and keep a small gutter */
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .calculator-grid .calculator-card {
        max-width: 100%;
    }

    .calculator-card,
    .interpretation-card {
        padding: 25px;
    }

    /* Stack and center VIG highlight on mobile */
    .vig-highlight {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
    }
    .vig-value {
        font-size: 32px;
        align-self: center;
    }
}

/* Override base_inside content padding on calculator pages (mobile only) */
@media (max-width: 767.98px) {
    body:has(.sidebar) .content:has(.calculator-container) {
        padding: 15px 0 !important;
    }
    body:has(.sidebar) .main-wrapper:has(.calculator-container) {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}
