/* ============================================
   Discount Calculator Styles
   Reuses tip-calculator patterns
   ============================================ */

.calculator-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.calculator-card .card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
}

.input-group-custom { margin-bottom: 1.5rem; }
.input-group-custom label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; }

.input-with-prefix, .input-with-suffix { position: relative; display: flex; align-items: center; }
.input-prefix, .input-suffix { position: absolute; font-size: 1.1rem; font-weight: 700; color: var(--text-muted); z-index: 1; }
.input-prefix { left: 16px; }
.input-suffix { right: 16px; }
.input-with-prefix .form-input { padding-left: 40px; }
.input-with-suffix .form-input { padding-right: 40px; }

.form-input {
    width: 100%; padding: 14px 16px; font-size: 1.25rem; font-weight: 700;
    color: var(--text-primary); background-color: var(--bg-input);
    border: 2px solid var(--border-color); border-radius: var(--radius-lg);
    outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15); }
.form-input::placeholder { color: var(--text-muted); font-weight: 400; }

/* Discount Presets */
.discount-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }

.discount-preset-btn {
    padding: 10px 8px; font-size: 0.9rem; font-weight: 700;
    color: var(--text-secondary); background: var(--bg-secondary);
    border: 2px solid var(--border-color); border-radius: var(--radius-md);
    cursor: pointer; transition: all 0.15s ease;
}
.discount-preset-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.discount-preset-btn.active { background: var(--brand-primary); border-color: var(--brand-primary); color: white; }

.custom-discount-wrap { margin-top: 10px; }

/* Slider */
.discount-slider-wrap { margin-top: 12px; }
.discount-slider {
    width: 100%; height: 6px; -webkit-appearance: none; appearance: none;
    background: var(--bg-tertiary); border-radius: 3px; outline: none;
}
.discount-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
    background: var(--brand-primary); cursor: pointer; box-shadow: 0 2px 6px rgba(6, 182, 212, 0.4);
}
.discount-slider::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--brand-primary); cursor: pointer; border: none;
}
.slider-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
#slider-value { color: var(--brand-primary); font-weight: 800; font-size: 0.85rem; }

/* Toggles */
.second-discount-toggle, .tax-toggle { display: flex; justify-content: space-between; align-items: center; }
.toggle-label { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); }

.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider-toggle {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-tertiary); border-radius: 26px; transition: 0.3s;
}
.slider-toggle:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px;
    background-color: white; border-radius: 50%; transition: 0.3s;
}
input:checked + .slider-toggle { background-color: var(--brand-primary); }
input:checked + .slider-toggle:before { transform: translateX(24px); }

/* Results */
.results-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 1.5rem; }
.result-card {
    background-color: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 18px; display: flex;
    align-items: center; gap: 14px; transition: transform 0.2s, box-shadow 0.2s;
}
.result-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.result-icon {
    width: 48px; height: 48px; border-radius: 12px; display: flex;
    align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.result-card.primary .result-icon { background: rgba(6, 182, 212, 0.15); color: var(--brand-primary); }
.result-card.success .result-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.result-card.info .result-icon { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.result-card.warning .result-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.result-info { display: flex; flex-direction: column; }
.result-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.result-value { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); line-height: 1; }

/* Savings Bar */
.savings-bar-container { margin-top: 0.5rem; }
.savings-bar { width: 100%; height: 32px; background: rgba(16, 185, 129, 0.15); border-radius: var(--radius-lg); overflow: hidden; position: relative; }
.savings-bar-fill {
    height: 100%; background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: var(--radius-lg); display: flex; align-items: center;
    justify-content: center; transition: width 0.5s ease; min-width: 40px;
}
.savings-bar-fill span { color: white; font-size: 0.8rem; font-weight: 700; }
.savings-bar-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.85rem; color: var(--text-secondary); }
.savings-label-save strong { color: #10b981; }
.savings-label-pay strong { color: var(--text-primary); }

/* Breakdown */
.breakdown-table { display: flex; flex-direction: column; gap: 8px; }
.breakdown-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; background: var(--bg-secondary);
    border-radius: var(--radius-md); border: 1px solid var(--border-color);
}
.breakdown-row.discount-row { background: rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.2); }
.discount-value { color: #ef4444 !important; }
.breakdown-row.subtotal { background: rgba(16, 185, 129, 0.05); border-color: rgba(16, 185, 129, 0.2); }
.breakdown-row.total {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-color: rgba(6, 182, 212, 0.3);
}
.breakdown-label { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); }
.breakdown-value { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.breakdown-row.total .breakdown-label, .breakdown-row.total .breakdown-value { font-weight: 800; color: var(--brand-primary); }

/* Comparison */
.comparison-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.comparison-item {
    text-align: center; padding: 12px 8px; background: var(--bg-secondary);
    border-radius: var(--radius-md); border: 1px solid var(--border-color); transition: all 0.15s ease;
}
.comparison-item.active { background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(6, 182, 212, 0.05) 100%); border-color: var(--brand-primary); }
.comparison-pct { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.comparison-save { font-size: 0.85rem; font-weight: 600; color: #ef4444; }
.comparison-price { font-size: 1rem; font-weight: 800; color: var(--text-primary); }
.comparison-item.active .comparison-pct { color: var(--brand-primary); }

/* Guide, Share, Info, FAQ - reuse tip calculator styles */
.tipping-guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.guide-item { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg-secondary); border-radius: var(--radius-md); border: 1px solid var(--border-color); }
.guide-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.guide-info { display: flex; flex-direction: column; }
.guide-title { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.guide-range { font-size: 0.8rem; font-weight: 600; color: var(--brand-primary); }

.share-section { text-align: center; }
.share-buttons { display: flex; justify-content: center; gap: 0.625rem; flex-wrap: wrap; }
.share-btn { width: 44px; height: 44px; border-radius: 50%; border: none; color: white; font-size: 1.1rem; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; }
.share-btn:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.share-btn.whatsapp { background-color: #25D366; }
.share-btn.twitter { background-color: #1DA1F2; }
.share-btn.facebook { background-color: #1877F2; }
.share-btn.copy { background-color: var(--gray-500); }

.info-box { padding: 1.25rem; background-color: var(--bg-secondary); border-radius: var(--radius-md); margin-bottom: 1rem; border-left: 4px solid var(--brand-primary); }
.info-box:last-child { margin-bottom: 0; }
.info-box h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.info-box p { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 0; line-height: 1.6; }

.faq-item { padding: 1.25rem; background-color: var(--bg-secondary); border-radius: var(--radius-md); margin-bottom: 1rem; }
.faq-item:last-child { margin-bottom: 0; }
.faq-question { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.faq-answer { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 0; line-height: 1.6; }

@media (max-width: 767.98px) {
    .calculator-card { padding: 1.25rem; }
    .discount-presets { grid-template-columns: repeat(4, 1fr); }
    .results-grid { grid-template-columns: 1fr; }
    .comparison-grid { grid-template-columns: repeat(3, 1fr); }
    .tipping-guide { grid-template-columns: 1fr; }
    .result-value { font-size: 1.25rem; }
}
