/* Calculator Edge 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: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 50px;
}

.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;
}

.format-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.format-selector.two-cols {
    grid-template-columns: repeat(2, 1fr);
}

.format-option {
    position: relative;
}

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

.format-label {
    display: block;
    padding: 12px 15px;
    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: 14px;
    color: #FFFFFF;
}

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

.format-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;
}

.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-top: 30px;
    border-top: 1px solid #393939;
}

.result-container h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: #9B9B9B;
    text-align: center;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    background: #0A0A0A;
    border: 2px solid #393939;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.5s ease;
}

.result-value.positive {
    background: linear-gradient(135deg, rgba(0, 255, 100, 0.1) 0%, rgba(0, 200, 80, 0.05) 100%);
    border-color: #00C850;
}

.result-value.negative {
    background: linear-gradient(135deg, rgba(255, 50, 50, 0.1) 0%, rgba(200, 0, 0, 0.05) 100%);
    border-color: #C83232;
}

.value-output {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 48px;
    line-height: 1;
    color: #FFFFFF;
}

.result-value.positive .value-output {
    color: #00FF64;
}

.result-value.negative .value-output {
    color: #FF3232;
}

.explanation-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);
}

.explanation-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;
}

.explanation-card p {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.8;
    color: #B0B0B0;
    margin-bottom: 20px;
}

.explanation-card ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.explanation-card li {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.8;
    color: #B0B0B0;
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
}

.explanation-card li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #5499FF;
    font-size: 20px;
}

.explanation-card strong {
    font-weight: 600;
    color: #FFFFFF;
}

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

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

html.light-mode .calculator-grid {
    /* grid stays the same; ensure spacing reads well on light */
}

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 .format-label {
    background: #ffffff;
    border: 1px solid #dddddd;
    color: #000000;
}

html.light-mode .format-option input[type="radio"]:checked + .format-label {
    /* keep the blue gradient for emphasis */
    color: #ffffff;
    border-color: transparent;
}

html.light-mode .format-label:hover {
    border-color: #5499FF;
}

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

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

html.light-mode .result-container {
    border-color: #eaeaea;
}

html.light-mode .result-container h3 {
    color: #666666;
}

html.light-mode .result-value {
    background: #ffffff;
    border: 2px solid #eeeeee;
}

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

html.light-mode .result-value.positive {
    background: linear-gradient(135deg, rgba(0, 200, 80, 0.06) 0%, rgba(0, 180, 60, 0.03) 100%);
    border-color: #36c369;
}

html.light-mode .result-value.negative {
    background: linear-gradient(135deg, rgba(200, 0, 0, 0.06) 0%, rgba(180, 0, 0, 0.03) 100%);
    border-color: #d26a6a;
}

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

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

html.light-mode .explanation-card p,
html.light-mode .explanation-card li {
    color: #333333;
}

html.light-mode .explanation-card strong {
    color: #000000;
}

html.light-mode .explanation-card li::before {
    color: #0662ED; /* slightly darker blue on light bg */
}

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

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

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

@media (max-width: 576px) {
    .calculator-header h1 {
        font-size: 28px;
    }
    
    .calculator-header p {
        font-size: 16px;
    }
    
    /* Reduce side spacing so the grid fills closer to screen edges */
    .calculator-container {
        /* counter the outer .container padding while keeping a small gutter */
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .calculator-card,
    .explanation-card {
        padding: 25px;
    }
    
    .value-output {
        font-size: 36px;
    }
    
    .format-selector {
        grid-template-columns: 1fr;
    }
    
    .format-selector.two-cols {
        grid-template-columns: 1fr;
    }
}

/* 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;
    }
}
