/* Calculator Page - Compact Viewport-Fit Design */

/* Page Layout */
.calc-page {
    min-height: calc(100vh - 60px);
    padding: 80px 20px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-container {
    max-width: 900px;
    width: 100%;
}

/* Header - Compact */
.calc-header {
    text-align: center;
    margin-bottom: 24px;
}

.calc-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
}

.calc-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Main Grid - Side by Side */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

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

/* Inputs Panel */
.calc-inputs {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.input-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* Product Pills */
.product-pills {
    display: flex;
    gap: 8px;
}

.product-pill {
    flex: 1;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.product-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.product-pill.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #fff;
}

.pill-fee {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.product-pill.active .pill-fee {
    color: #10b981;
}

/* Main Slider */
.main-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.main-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    transition: transform 0.15s ease;
}

.main-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.main-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.slider-range {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4px;
}

/* Volume Helper */
.volume-helper {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
}

.helper-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.helper-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.helper-hint {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.helper-sliders {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 500px) {
    .helper-sliders {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.mini-slider-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.mini-header label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.mini-header span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.mini-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.mini-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mini-slider::-webkit-slider-thumb:hover {
    background: #fff;
}

.mini-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Disabled state for sliders (e.g., leverage for spot) */
.mini-slider-group.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.mini-slider-group.disabled .mini-header label::after {
    content: ' (N/A)';
    font-style: italic;
}

.helper-result {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.helper-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.helper-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #10b981;
    font-variant-numeric: tabular-nums;
}

/* Period Toggle */
.period-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 3px;
}

.period-btn {
    flex: 1;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.period-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.period-btn.active {
    background: rgba(16, 185, 129, 0.15);
    color: #fff;
}

/* Results Panel */
.calc-results {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Hero Cashback */
.result-hero {
    text-align: center;
    padding: 16px 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
}

.result-hero-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.result-hero-value {
    display: block;
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    font-weight: 800;
    color: #4ade80;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.result-hero-period {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* Stats Row */
.result-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.result-stat {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.stat-rate {
    color: #10b981;
}

/* Visual Bars */
.result-visual {
    margin-bottom: 16px;
}

.bar-row {
    display: grid;
    grid-template-columns: 90px 1fr 60px;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.bar-row:last-child {
    margin-bottom: 0;
}

.bar-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.bar-without {
    background: linear-gradient(90deg, #6b7280, #4b5563);
    width: 100%;
}

.bar-with {
    background: linear-gradient(90deg, #4ade80, #22c55e);
    width: 80%;
}

.bar-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.bar-value-savings {
    color: #4ade80;
}

/* CTA */
.calc-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: auto;
}

.calc-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.calc-cta-note {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 8px 0 0;
}

/* Fee Info Cards */
.fee-info {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}

.fee-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.fee-card-icon {
    font-size: 1rem;
}

.fee-card-name {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.fee-card-rate {
    font-size: 0.8rem;
    font-weight: 600;
    color: #10b981;
}

.fee-note {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .calc-page {
        padding: 70px 16px 20px;
        align-items: flex-start;
    }
    
    .calc-header {
        margin-bottom: 16px;
    }
    
    .calc-inputs,
    .calc-results {
        padding: 16px;
    }
    
    .result-hero {
        padding: 12px 0 16px;
    }
    
    .result-hero-value {
        font-size: 2.5rem;
    }
    
    .fee-info {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .fee-card {
        padding: 6px 10px;
    }
    
    .bar-row {
        grid-template-columns: 80px 1fr 50px;
        gap: 8px;
    }
    
    .bar-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 400px) {
    .product-pills {
        flex-direction: column;
    }
    
    .product-pill {
        flex-direction: row;
        justify-content: space-between;
    }
}
