/* ============================================
   Tip Calculator Styles
   ============================================ */

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

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

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

.tip-preset-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.tip-preset-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

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

/* Tip Slider */
.tip-slider-wrap {
    margin-top: 12px;
}

.tip-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}

.tip-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    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);
}

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

/* People Selector */
.people-selector {
    display: flex;
    align-items: center;
    gap: 16px;
}

.people-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.people-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: var(--bg-tertiary);
}

.people-count {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    min-width: 40px;
    text-align: center;
}

.people-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Round Up Toggle */
.round-up-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 Grid */
.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;
}

/* Breakdown Table */
.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.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-row.split {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-color: rgba(59, 130, 246, 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 Grid */
.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-tip { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.comparison-total { font-size: 1rem; font-weight: 800; color: var(--text-primary); }
.comparison-item.active .comparison-pct { color: var(--brand-primary); }

/* Tipping Guide */
.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 */
.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 & FAQ */
.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; }

/* Responsive */
@media (max-width: 767.98px) {
    .calculator-card { padding: 1.25rem; }
    .tip-presets { grid-template-columns: repeat(3, 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; }
}
