/* ============================================
   JASMINE FARMING ROI CALCULATOR — STYLES
   ============================================ */

/* ==================== CALCULATOR SECTION ==================== */
.calculator-section {
    padding: var(--space-4xl) 0;
    background: linear-gradient(180deg, var(--neutral-50) 0%, white 100%);
}

.calculator-section .section-container {
    max-width: 1100px;
}

/* ==================== CALCULATOR WRAPPER ==================== */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    margin-top: var(--space-2xl);
}

/* ==================== INPUT PANEL ==================== */
.calc-input-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.calc-card {
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
}

.calc-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--neutral-100);
}

.calc-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.calc-card-icon.green { background: rgba(74, 124, 89, 0.1); }
.calc-card-icon.gold { background: rgba(232, 197, 71, 0.15); }
.calc-card-icon.blue { background: rgba(66, 133, 244, 0.1); }
.calc-card-icon.pink { background: rgba(232, 180, 184, 0.15); }

.calc-card-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--neutral-800);
    margin: 0;
}

/* ==================== FORM FIELDS ==================== */
.calc-field {
    margin-bottom: var(--space-lg);
}

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

.calc-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.calc-label-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--neutral-700);
}

.calc-label-unit {
    font-size: 0.75rem;
    color: var(--neutral-400);
}

.calc-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--neutral-800);
    background: var(--neutral-50);
    transition: all var(--transition-fast);
    box-sizing: border-box;
}

.calc-input:focus {
    outline: none;
    border-color: var(--jasmine-green);
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.calc-input::placeholder {
    color: var(--neutral-400);
}

/* Range slider */
.calc-range-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.calc-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--neutral-200);
    border-radius: 3px;
    outline: none;
}

.calc-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--jasmine-green);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(74, 124, 89, 0.3);
    transition: transform 0.15s ease;
}

.calc-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.calc-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--jasmine-green);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(74, 124, 89, 0.3);
}

.calc-range-value {
    min-width: 70px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--jasmine-green-dark);
    font-family: var(--font-body);
}

/* Select dropdown */
.calc-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--neutral-800);
    background: var(--neutral-50);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%237A7A6B' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.calc-select:focus {
    outline: none;
    border-color: var(--jasmine-green);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

/* Currency prefix */
.calc-input-group {
    display: flex;
    align-items: stretch;
}

.calc-input-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 0.9rem;
    color: var(--neutral-500);
    font-weight: 500;
}

.calc-input-group .calc-input {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ==================== RESULTS PANEL ==================== */
.calc-results-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    position: sticky;
    top: calc(var(--nav-height) + var(--space-xl));
    align-self: start;
}

/* Summary cards */
.result-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.result-summary-card {
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all var(--transition-normal);
}

.result-summary-card:hover {
    box-shadow: var(--shadow-md);
}

.result-summary-card.highlight {
    border-color: var(--jasmine-green);
    background: linear-gradient(135deg, rgba(74, 124, 89, 0.04), rgba(74, 124, 89, 0.02));
}

.result-summary-card.highlight.negative {
    border-color: var(--jasmine-pink);
    background: linear-gradient(135deg, rgba(232, 180, 184, 0.08), rgba(232, 180, 184, 0.02));
}

.result-label {
    font-size: 0.75rem;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.result-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neutral-800);
    line-height: 1.2;
}

.result-value.positive { color: var(--jasmine-green-dark); }
.result-value.negative { color: #C0392B; }

.result-subtext {
    font-size: 0.72rem;
    color: var(--neutral-400);
    margin-top: 4px;
}

/* ==================== CHART CONTAINERS ==================== */
.calc-chart-card {
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
}

.calc-chart-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--neutral-700);
    margin-bottom: var(--space-lg);
    text-align: center;
}

/* Bar chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 180px;
    padding: 0 var(--space-md);
    border-bottom: 1px solid var(--neutral-200);
    margin-bottom: var(--space-md);
}

.bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    max-width: 40px;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease, background 0.3s ease;
    position: relative;
    min-height: 2px;
}

.bar.cost { background: linear-gradient(180deg, #E8B4B8, #D4A0A4); }
.bar.revenue { background: linear-gradient(180deg, #6B9B7A, #4A7C59); }
.bar.profit { background: linear-gradient(180deg, #E8C547, #D4A843); }
.bar.loss { background: linear-gradient(180deg, #E07A5F, #C0392B); }

.bar-label {
    font-size: 0.65rem;
    color: var(--neutral-500);
    margin-top: 8px;
    text-align: center;
    line-height: 1.2;
}

.bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--neutral-600);
    white-space: nowrap;
}

/* Chart legend */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--neutral-500);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-dot.cost { background: #E8B4B8; }
.legend-dot.revenue { background: #4A7C59; }
.legend-dot.profit { background: #E8C547; }

/* ==================== BREAKDOWN TABLE ==================== */
.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.breakdown-table th {
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--neutral-700);
    background: var(--neutral-50);
    border-bottom: 2px solid var(--neutral-200);
}

.breakdown-table th:last-child,
.breakdown-table td:last-child {
    text-align: right;
}

.breakdown-table td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--neutral-100);
    color: var(--neutral-600);
}

.breakdown-table tr:hover td {
    background: rgba(232, 197, 71, 0.04);
}

.breakdown-table .total-row td {
    font-weight: 700;
    color: var(--neutral-800);
    border-top: 2px solid var(--neutral-300);
    border-bottom: none;
    padding-top: 10px;
}

.breakdown-table .total-row td:last-child {
    color: var(--jasmine-green-dark);
}

/* ==================== SENSITIVITY ANALYSIS ==================== */
.sensitivity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.sensitivity-item {
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.sensitivity-label {
    font-size: 0.72rem;
    color: var(--neutral-500);
    margin-bottom: 4px;
}

.sensitivity-value {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
}

.sensitivity-value.positive { color: var(--jasmine-green-dark); }
.sensitivity-value.negative { color: #C0392B; }

/* ==================== PRESET BUTTONS ==================== */
.preset-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.preset-btn {
    padding: 6px 14px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-xl);
    background: white;
    color: var(--neutral-600);
    font-size: 0.78rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    background: var(--jasmine-cream);
    border-color: var(--jasmine-gold);
    color: var(--jasmine-deep);
}

.preset-btn.active {
    background: var(--jasmine-green);
    color: white;
    border-color: var(--jasmine-green);
}

/* ==================== DISCLAIMER ==================== */
.calc-disclaimer {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    background: var(--jasmine-cream);
    border: 1px solid var(--jasmine-pale);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--neutral-600);
    line-height: 1.7;
    text-align: center;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }

    .calc-results-panel {
        position: static;
    }

    .result-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .result-summary-grid {
        grid-template-columns: 1fr;
    }

    .sensitivity-grid {
        grid-template-columns: 1fr;
    }

    .bar-chart {
        height: 140px;
    }

    .calc-card {
        padding: var(--space-lg);
    }

    .preset-row {
        gap: 6px;
    }

    .preset-btn {
        padding: 5px 10px;
        font-size: 0.72rem;
    }
}
