/* ===== KALKULATOR PAGE STYLES ===== */

/* Active nav button */
.nav-btn--active {
    background: var(--accent) !important;
    color: #fff !important;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ===== PAGE HEADER ===== */
#kalkulator-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 24px 60px;
    overflow: hidden;
}

.kalkulator-hero-glow {
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, .12) 0%, transparent 70%);
    opacity: .5;
    pointer-events: none;
    animation: pulse-glow 6s ease-in-out infinite;
}

.kalkulator-hero-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
}

.kalkulator-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    animation: fade-up .8s ease both;
}

.kalkulator-hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    font-weight: 400;
    max-width: 560px;
    margin: 0 auto;
    animation: fade-up .8s ease .15s both;
}

/* ===== CALCULATOR SECTION ===== */
#calculator {
    padding: 0 24px 60px;
}

.calculator-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}

/* ===== CALC ITEMS ===== */
.calc-items-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calc-item {
    position: relative;
    padding: 28px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    overflow: hidden;
    animation: fade-up .6s ease both;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.06);
}

.calc-item:nth-child(1) { animation-delay: 0s; }
.calc-item:nth-child(2) { animation-delay: .1s; }
.calc-item:nth-child(3) { animation-delay: .2s; }

.calc-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(56, 189, 248, .06), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition);
}

.calc-item:hover {
    border-color: rgba(37, 99, 235, .2);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37, 99, 235, .08);
    background: var(--bg-card-hover);
}

.calc-item:hover::before {
    opacity: 1;
}

/* Highlight when quantity > 0 */
.calc-item.calc-item--active {
    border-color: rgba(37, 99, 235, .25);
    box-shadow: 0 4px 20px rgba(37, 99, 235, .1);
}

.calc-item-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
}

.calc-item-icon-wrap {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: 12px;
    transition: background var(--transition);
}

.calc-item:hover .calc-item-icon-wrap,
.calc-item.calc-item--active .calc-item-icon-wrap {
    background: rgba(37, 99, 235, .15);
}

.calc-item-icon {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.calc-item-info {
    flex: 1;
    min-width: 0;
}

.calc-item-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 2px;
}

.calc-item-desc {
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.calc-item-price-tag {
    display: flex;
    align-items: baseline;
    gap: 4px;
    background: var(--accent-soft);
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, .12);
    white-space: nowrap;
    flex-shrink: 0;
}

.calc-item-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
}

.calc-item-currency {
    font-size: .8rem;
    font-weight: 600;
    color: var(--accent);
}

.calc-item-per {
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== ITEM CONTROLS ===== */
.calc-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.calc-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
    flex-shrink: 0;
}

.calc-btn svg {
    width: 18px;
    height: 18px;
}

.calc-btn:hover {
    border-color: rgba(37, 99, 235, .3);
    color: var(--accent);
    background: var(--accent-soft);
    transform: scale(1.08);
}

.calc-btn:active {
    transform: scale(.95);
}

.calc-btn-minus:hover {
    border-color: rgba(239, 68, 68, .3);
    color: #ef4444;
    background: rgba(239, 68, 68, .08);
}

.calc-input {
    width: 80px;
    height: 44px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    outline: none;
    transition: all var(--transition);
    -moz-appearance: textfield;
}

.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.calc-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.calc-item-subtotal {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 10px 20px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.calc-item--active .calc-item-subtotal {
    background: var(--accent-soft);
    border-color: rgba(37, 99, 235, .15);
}

.calc-subtotal-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    transition: color var(--transition);
    min-width: 40px;
    text-align: right;
}

.calc-item--active .calc-subtotal-value {
    color: var(--accent);
}

.calc-subtotal-currency {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ===== SUMMARY PANEL ===== */
.calc-summary {
    position: sticky;
    top: 100px;
    padding: 36px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: fade-up .6s ease .3s both;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.06);
}

.calc-summary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(56, 189, 248, .08) 0%, transparent 70%);
    opacity: .4;
    pointer-events: none;
}

.calc-summary-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    position: relative;
}

.calc-summary-icon-wrap {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: 12px;
}

.calc-summary-icon {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.calc-summary-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

/* Summary Rows */
.calc-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.calc-summary-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    opacity: .5;
}

.calc-summary-row.calc-summary-row--active {
    opacity: 1;
    border-color: rgba(37, 99, 235, .15);
}

.calc-summary-label {
    font-size: .85rem;
    font-weight: 500;
    color: var(--text);
}

.calc-summary-qty {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: right;
}

.calc-summary-amount {
    font-size: .9rem;
    font-weight: 700;
    color: var(--accent);
    text-align: right;
    min-width: 70px;
}

/* Divider */
.calc-summary-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
    margin: 24px 0;
}

/* Total */
.calc-summary-total {
    text-align: center;
    position: relative;
}

.calc-total-label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.calc-total-amount-wrap {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}

.calc-total-amount {
    font-size: 2.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all var(--transition);
}

.calc-total-currency {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.calc-total-period {
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Note */
.calc-summary-note {
    margin-top: 20px;
    font-size: .78rem;
    color: var(--text-muted);
    line-height: 1.6;
    text-align: center;
    position: relative;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* Pulse animation for total on change */
@keyframes total-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.calc-total-amount.pulse {
    animation: total-pulse .35s ease;
}

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

    .calc-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    #kalkulator-hero {
        padding: 120px 24px 40px;
    }

    .calc-item {
        padding: 24px 20px;
    }

    .calc-item-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .calc-item-price-tag {
        margin-left: auto;
    }

    .calc-item-controls {
        flex-wrap: wrap;
    }

    .calc-item-subtotal {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }

    .calc-summary {
        padding: 28px 20px;
    }

    .calc-summary-row {
        grid-template-columns: 1fr;
        gap: 4px;
        text-align: left;
    }

    .calc-summary-qty,
    .calc-summary-amount {
        text-align: left;
    }
}

@media (max-width: 480px) {
    #kalkulator-hero {
        padding: 140px 16px 32px;
    }

    .calc-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .calc-item-price-tag {
        margin-left: 0;
    }

    .calc-total-amount {
        font-size: 2rem;
    }
}
