/* ============================================
   SPLLITO CALCULATOR - MODERN REDESIGN
   Elegant, animated, mobile-first
   ============================================ */

/* === BASE CALCULATOR CONTAINER === */
.calculator-container {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 24px 48px -12px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(108, 99, 255, 0.06);
    border-radius: 28px;
    overflow: hidden;
    max-width: 860px;
    margin: 0 auto;
    transition: box-shadow 0.4s ease;
}

.calculator-container:hover {
    box-shadow:
        0 32px 64px -16px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(108, 99, 255, 0.1);
}

/* === HEADER WITH STEPS === */
.calculator-header {
    background: linear-gradient(135deg, #fafbff 0%, #ffffff 100%);
    padding: 1.75rem 2rem 1.25rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

/* Currency selector */
.currency-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.currency-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.currency-label i {
    font-size: 0.85rem;
    color: var(--primary);
}

.currency-dropdown-container {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #e8ecf4;
    transition: all 0.25s ease;
}

.currency-dropdown-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.currency-dropdown-container select {
    border: none;
    background: transparent;
    padding: 0.55rem 2rem 0.55rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    font-family: 'Inter', sans-serif;
}

.currency-chevron {
    position: absolute;
    right: 0.7rem;
    font-size: 0.65rem;
    color: var(--gray-400);
    pointer-events: none;
}

/* === STEP INDICATOR === */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    position: relative;
    max-width: 420px;
    margin: 0 auto;
}

/* Connecting line */
.step-indicator::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 70px;
    right: 70px;
    height: 2px;
    background: #e8ecf4;
    z-index: 0;
    border-radius: 10px;
}

/* Animated progress overlay */
.step-indicator::after {
    content: '';
    position: absolute;
    top: 22px;
    left: 70px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 1;
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 0%;
}

.step-indicator[data-progress="1"]::after { width: 50%; }
.step-indicator[data-progress="2"]::after { width: 100%; }

.step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex: 1;
    transition: all 0.3s ease;
    padding: 0 0.5rem;
}

.step-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.step-number {
    width: 44px;
    height: 44px;
    background: white;
    border: 2.5px solid #e0e4ed;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #b0b8c9;
    transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
}

.step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.12);
    box-shadow: 0 8px 24px -4px rgba(108, 99, 255, 0.4);
}

.step.completed .step-number {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
    box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.35);
}

/* Checkmark inside completed step */
.step.completed .step-number::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
    position: absolute;
}

.step.completed .step-number span {
    display: none;
}

.step-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    transition: all 0.3s ease;
    letter-spacing: 0.01em;
}

.step.active .step-text {
    color: var(--primary);
}

.step.completed .step-text {
    color: var(--secondary);
}

/* === CALCULATOR BODY === */
.calculator-body {
    padding: 2rem;
}

/* === SECTION TRANSITIONS === */
.calc-section {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.calc-section.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Section titles */
.calc-section > h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calc-section > h3 .section-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(108, 99, 255, 0.05));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 0.85rem;
}

/* === INPUT GROUPS === */
.modern-input-group {
    position: relative;
    margin-bottom: 1rem;
}

.modern-input-group input,
.modern-input-group select {
    width: 100%;
    padding: 1rem 1rem 1rem 3.25rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-800);
    background: #f7f8fb;
    border: 2px solid transparent;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    outline: none;
}

.modern-input-group input:hover,
.modern-input-group select:hover {
    background: #f0f2f7;
}

.modern-input-group input:focus,
.modern-input-group select:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.08);
}

.modern-input-group input::placeholder {
    color: #b8c0d0;
    font-weight: 400;
}

.modern-input-group i,
.modern-input-group .currency-symbol {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #b0b8c9;
    font-size: 1rem;
    transition: color 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.modern-input-group input:focus ~ i,
.modern-input-group input:focus + i,
.modern-input-group input:focus + .currency-symbol,
.modern-input-group select:focus ~ i {
    color: var(--primary);
}

/* === ADD PERSON FORM === */
.add-person-form {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.add-person-form .modern-input-group {
    flex: 1;
    margin-bottom: 0;
}

.add-person-form .btn-primary {
    padding: 0 1.75rem;
    border-radius: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.add-person-form .btn-primary:active {
    transform: scale(0.96);
}

/* === PEOPLE GRID === */
.people-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
    min-height: 0;
}

/* Person Chip - pill style */
.modern-person-chip {
    background: white;
    border: 1.5px solid #e8ecf4;
    border-radius: 50px;
    padding: 0.5rem 0.65rem 0.5rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
    position: relative;
    animation: chipAppear 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes chipAppear {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modern-person-chip:hover {
    border-color: var(--primary);
    background: #fafaff;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.08);
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.modern-person-chip:hover .avatar-circle {
    transform: scale(1.08);
}

.chip-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--gray-700);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.delete-chip {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.delete-chip:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: scale(1.1);
}

.delete-chip i {
    font-size: 0.65rem;
}

/* Person count badge */
.people-count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(108, 99, 255, 0.08);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    margin-top: 1rem;
}

.people-count i {
    font-size: 0.7rem;
}

/* === EXPENSE FORM CARD === */
.expense-form-card {
    background: linear-gradient(135deg, #f8f9fd 0%, #f4f5fa 100%);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1.5px solid #e8ecf4;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.expense-form-card:focus-within {
    border-color: rgba(108, 99, 255, 0.2);
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.06);
}

.expense-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.expense-form-card .btn-primary {
    width: 100%;
    margin-top: 1rem;
    border-radius: 14px;
    padding: 0.9rem 1.5rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.expense-form-card .btn-primary:active {
    transform: scale(0.97);
}

/* Quick add buttons */
.quick-add-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.quick-add-label {
    font-size: 0.72rem;
    color: var(--gray-400);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.quick-add-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    border: 1.5px solid #e0e4ed;
    background: white;
    color: var(--gray-600);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.quick-add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(108, 99, 255, 0.04);
}

.quick-add-btn:active {
    transform: scale(0.95);
}

/* === EXPENSE LIST === */
.modern-expense-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.modern-expense-item {
    background: white;
    border: 1.5px solid #eef0f6;
    border-radius: 16px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: all 0.3s ease;
    animation: itemSlideIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes itemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.modern-expense-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.06);
}

.expense-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #059669;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.expense-details {
    flex: 1;
    min-width: 0;
}

.expense-details h4 {
    margin: 0;
    color: var(--gray-800);
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expense-details p {
    margin: 2px 0 0;
    color: var(--gray-400);
    font-size: 0.78rem;
    font-weight: 500;
}

.expense-amount-tag {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    padding: 0.4rem 0.85rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.88rem;
    color: #059669;
    white-space: nowrap;
    border: 1px solid #bbf7d0;
}

/* Expense total bar */
.expense-total-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--primary), #8b7aff);
    border-radius: 14px;
    color: white;
}

.expense-total-bar .total-label {
    font-size: 0.82rem;
    font-weight: 500;
    opacity: 0.85;
}

.expense-total-bar .total-amount {
    font-size: 1.25rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
}

/* === EMPTY STATES === */
.modern-empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: #b0b8c9;
    background: #fafbfd;
    border-radius: 16px;
    border: 2px dashed #e0e4ed;
    margin-top: 1.25rem;
    transition: all 0.3s ease;
}

.modern-empty-state i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
    display: block;
}

.modern-empty-state p {
    font-size: 0.88rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

/* === NAVIGATION BUTTONS === */
.calc-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 0.75rem;
}

.calc-nav .btn-next {
    flex: 1;
    max-width: 280px;
    margin-left: auto;
}

/* Next/back button styles */
.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.75rem;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
    font-family: 'Inter', sans-serif;
}

.btn-nav:active {
    transform: scale(0.96);
}

.btn-nav-primary {
    background: linear-gradient(135deg, var(--secondary), #0d9488);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.btn-nav-primary:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.btn-nav-back {
    background: #f1f3f9;
    color: var(--gray-600);
}

.btn-nav-back:hover {
    background: #e8eaf2;
    color: var(--gray-800);
}

/* === RESULTS SECTION === */
.results-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.results-header h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gray-800);
    margin: 0 0 0.25rem;
}

.results-header p {
    font-size: 0.85rem;
    color: var(--gray-400);
    margin: 0;
}

/* Settlement card */
.settlement-card {
    background: white;
    border: 1.5px solid #eef0f6;
    border-radius: 20px;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.settlement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), #f59e0b);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Stats row */
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 1.5rem;
}

.stat-card {
    text-align: center;
    padding: 1.1rem 0.75rem;
    border-radius: 16px;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: scale(1.02);
}

.stat-card.green {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

.stat-card.blue {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.stat-card.green .stat-label { color: #166534; }
.stat-card.blue .stat-label { color: #1e40af; }

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}

.stat-card.green .stat-value { color: #15803d; }
.stat-card.blue .stat-value { color: #1d4ed8; }

/* Summary grid */
.summary-section {
    padding: 0 1.5rem 1rem;
}

.summary-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
    margin-bottom: 0.65rem;
}

.summary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.summary-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.summary-chip:hover { transform: scale(1.03); }

.summary-chip.positive {
    background: #ecfdf5;
    border: 1px solid #86efac;
    color: #166534;
}

.summary-chip.negative {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.summary-chip.neutral {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.summary-chip .chip-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.summary-chip .chip-status {
    font-size: 0.72rem;
    font-weight: 500;
    margin-left: 0.15rem;
}

/* Payment list */
.payments-section {
    padding: 0 1.5rem 1.5rem;
}

.payment-row {
    display: flex;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 0.75rem;
    transition: background 0.2s ease;
}

.payment-row:last-child {
    border-bottom: none;
}

.payment-row:hover {
    background: #fafbff;
    border-radius: 12px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin: 0 -0.5rem;
}

.payment-person {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.payment-person .person-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.payment-person .person-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payment-arrow {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    color: #cbd5e1;
}

.payment-arrow i {
    font-size: 1rem;
}

.money-badge {
    background: linear-gradient(135deg, var(--secondary), #0d9488);
    color: white;
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
    flex-shrink: 0;
    margin-left: auto;
}

/* All settled message */
.settled-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.5rem;
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

.settled-message i {
    font-size: 1.3rem;
}

/* === SHARE OPTIONS === */
.share-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 1.75rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-btn:active {
    transform: scale(0.97);
}

.share-btn.whatsapp-btn {
    background: #25D366;
    color: white;
}

.share-btn.copy-btn {
    background: #f1f3f9;
    color: var(--gray-700);
}

.share-btn.screenshot-btn {
    background: #f1f3f9;
    color: var(--gray-700);
}

.share-btn.copylink-btn {
    background: var(--primary);
    color: white;
}

.share-btn i {
    font-size: 1rem;
}

/* Start over / email row */
.share-actions-bottom {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.share-actions-bottom .share-btn {
    flex: 1;
    background: #f1f3f9;
    color: var(--gray-600);
    border: 1.5px solid #e8ecf4;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-in {
    animation: fadeInUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Staggered animations for list items */
.modern-expense-item:nth-child(1) { animation-delay: 0ms; }
.modern-expense-item:nth-child(2) { animation-delay: 50ms; }
.modern-expense-item:nth-child(3) { animation-delay: 100ms; }
.modern-expense-item:nth-child(4) { animation-delay: 150ms; }
.modern-expense-item:nth-child(5) { animation-delay: 200ms; }

.modern-person-chip:nth-child(1) { animation-delay: 0ms; }
.modern-person-chip:nth-child(2) { animation-delay: 40ms; }
.modern-person-chip:nth-child(3) { animation-delay: 80ms; }
.modern-person-chip:nth-child(4) { animation-delay: 120ms; }
.modern-person-chip:nth-child(5) { animation-delay: 160ms; }
.modern-person-chip:nth-child(6) { animation-delay: 200ms; }

/* === MOBILE RESPONSIVE === */

/* Tablet */
@media (max-width: 768px) {
    .calculator-container {
        border-radius: 22px;
        margin: 0 -0.25rem;
    }

    .calculator-header {
        padding: 1.5rem 1.25rem 1rem;
    }

    .calculator-body {
        padding: 1.5rem 1.25rem;
    }

    .step-indicator::before {
        top: 20px;
        left: 50px;
        right: 50px;
    }

    .step-indicator::after {
        top: 20px;
        left: 50px;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .step-text {
        font-size: 0.72rem;
    }

    .modern-input-group input,
    .modern-input-group select {
        padding: 0.95rem 1rem 0.95rem 3rem;
        font-size: 1rem; /* 16px prevents iOS zoom */
    }

    .add-person-form {
        flex-direction: column;
    }

    .add-person-form .btn-primary {
        padding: 0.95rem 1.5rem;
        border-radius: 14px;
        justify-content: center;
    }

    .expense-form-grid {
        grid-template-columns: 1fr;
    }

    .expense-form-card .btn-primary {
        padding: 1rem 1.5rem;
        min-height: 50px;
    }

    .people-grid {
        gap: 0.5rem;
    }

    .modern-person-chip {
        padding: 0.45rem 0.55rem 0.45rem 0.45rem;
    }

    .chip-name {
        font-size: 0.85rem;
    }

    .delete-chip {
        opacity: 1 !important;
        transform: scale(1) !important;
        width: 26px;
        height: 26px;
    }

    .modern-expense-item {
        padding: 0.75rem 0.85rem;
        gap: 0.65rem;
    }

    .expense-icon {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    /* Nav buttons */
    .calc-nav {
        flex-direction: column-reverse;
        gap: 0.6rem;
    }

    .calc-nav .btn-nav {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
        min-height: 52px;
    }

    .calc-nav .btn-nav-primary {
        order: -1;
    }

    /* Stats */
    .stats-row {
        padding: 1.25rem;
        gap: 0.6rem;
    }

    .stat-card {
        padding: 0.9rem 0.5rem;
    }

    .stat-card .stat-value {
        font-size: 1.3rem;
    }

    /* Share buttons */
    .share-options {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .share-btn {
        padding: 0.75rem 0.75rem;
        font-size: 0.78rem;
    }

    /* Settlement card */
    .settlement-card {
        border-radius: 18px;
    }

    /* Results */
    .payment-row {
        flex-wrap: wrap;
    }

    .money-badge {
        margin-left: 0;
    }

    .summary-section, .payments-section {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .calculator-container {
        border-radius: 18px;
    }

    .calculator-header {
        padding: 1.25rem 1rem 0.85rem;
    }

    .calculator-body {
        padding: 1.25rem 1rem;
    }

    .currency-wrapper {
        margin-bottom: 1rem;
    }

    .step-indicator::before {
        left: 40px;
        right: 40px;
        top: 18px;
    }

    .step-indicator::after {
        top: 18px;
        left: 40px;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
        border-radius: 12px;
    }

    .step-text {
        font-size: 0.68rem;
    }

    .modern-input-group input,
    .modern-input-group select {
        padding: 0.9rem 0.9rem 0.9rem 2.5rem;
        font-size: 1rem; /* Prevents iOS zoom */
        border-radius: 12px;
    }

    .modern-input-group i,
    .modern-input-group .currency-symbol {
        left: 0.85rem;
        font-size: 0.9rem;
    }

    .expense-form-card {
        padding: 1.15rem;
        border-radius: 16px;
    }

    .avatar-circle {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .expense-amount-tag {
        padding: 0.3rem 0.65rem;
        font-size: 0.82rem;
    }

    .share-options {
        grid-template-columns: 1fr;
    }

    .stats-row {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.15rem;
    }

    .stat-card .stat-label {
        font-size: 0.68rem;
    }

    .summary-section, .payments-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* === STICKY NAV FOR MOBILE === */
@media (max-width: 768px) {
    .calc-sticky-nav {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid rgba(226, 232, 240, 0.6);
        padding: 1rem 1.25rem;
        margin: 1.5rem -1.25rem -1.25rem;
        display: flex;
        gap: 0.6rem;
        z-index: 100;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.04);
    }

    .calc-sticky-nav .btn-nav {
        flex: 1;
        min-height: 52px;
    }

    .calc-sticky-nav .btn-nav-primary {
        flex: 2;
    }
}

/* === TOUCH DEVICE OPTIMIZATIONS === */
@media (hover: none) and (pointer: coarse) {
    .modern-person-chip:hover,
    .modern-expense-item:hover,
    .step:hover {
        transform: none;
        box-shadow: none;
    }

    .modern-person-chip:hover {
        border-color: #e8ecf4;
        background: white;
    }

    .modern-person-chip:active {
        background: #f8f9fd;
    }

    .modern-expense-item:active {
        background: #f8f9fd;
    }

    .delete-chip {
        opacity: 1;
        transform: scale(1);
        min-width: 34px;
        min-height: 34px;
    }

    .step-number {
        min-width: 44px;
        min-height: 44px;
    }

    /* Larger tap targets */
    .quick-add-btn {
        padding: 0.5rem 1rem;
        font-size: 0.82rem;
    }

    .share-btn {
        min-height: 48px;
    }

    /* Add active states for tactile feedback */
    .btn-nav:active,
    .share-btn:active,
    .quick-add-btn:active {
        transform: scale(0.96);
    }
}

/* === LANDSCAPE MODE === */
@media (max-height: 600px) and (orientation: landscape) {
    .calculator-header {
        padding: 1rem 1.5rem 0.75rem;
    }

    .step-indicator {
        margin-bottom: 0.75rem;
    }

    .calculator-body {
        padding: 1.25rem 1.5rem;
    }
}

/* === DARK MODE SUPPORT (future) === */
@media (prefers-reduced-motion: reduce) {
    .modern-person-chip,
    .modern-expense-item,
    .calc-section,
    .step-number,
    .settlement-card::before {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   MINI CALCULATOR WIDGET (landing page tools)
   ============================================ */
.mc-section {
    background: linear-gradient(180deg, #f0f2ff 0%, #f8f9ff 100%);
    padding: 3rem 1.5rem;
}
.mc-wrap { max-width: 540px; margin: 0 auto; }
.mc-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 48px rgba(108,99,255,.14), 0 2px 8px rgba(0,0,0,.04);
    overflow: hidden;
}
.mc-head {
    background: linear-gradient(135deg, #6C63FF, #4338CA);
    padding: 1.75rem 2rem;
    color: #fff;
    text-align: center;
}
.mc-head .mc-ico { font-size: 2rem; margin-bottom: .5rem; opacity: .9; }
.mc-head h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 .3rem;
    line-height: 1.3;
}
.mc-head p { font-size: .85rem; opacity: .85; margin: 0; }
.mc-body { padding: 1.75rem; }
.mc-f { margin-bottom: 1.1rem; }
.mc-f label {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .4rem;
}
.mc-f input, .mc-f select {
    width: 100%;
    padding: .85rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #1f2937;
    background: #f9fafb;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}
.mc-f input:focus, .mc-f select:focus {
    border-color: #6C63FF;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(108,99,255,.08);
}
.mc-f input::placeholder { color: #b8c0d0; }
.mc-tips {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.mc-tip {
    flex: 1;
    min-width: 58px;
    padding: .6rem .5rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    font-family: 'Inter', sans-serif;
    font-size: .88rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all .18s;
    text-align: center;
}
.mc-tip:hover, .mc-tip.on {
    border-color: #6C63FF;
    background: rgba(108,99,255,.08);
    color: #6C63FF;
}
.mc-calc-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #6C63FF, #4338CA);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    margin-top: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    letter-spacing: .01em;
}
.mc-calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(108,99,255,.38);
}
.mc-calc-btn:active { transform: scale(.98); }
.mc-res {
    padding: 1.25rem 1.75rem 1.75rem;
    border-top: 1px solid #ededff;
    background: #fafafe;
    display: none;
    animation: mcFadeIn .35s ease;
}
.mc-res.show { display: block; }
@keyframes mcFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.mc-res-title {
    font-family: 'Poppins', sans-serif;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #6b7280;
    margin-bottom: .85rem;
    text-align: center;
}
.mc-rg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: .65rem;
    margin-bottom: 1.1rem;
}
.mc-rc {
    background: #fff;
    border-radius: 14px;
    padding: 1rem .75rem;
    text-align: center;
    border: 1px solid #e8ecf4;
    transition: transform .2s;
}
.mc-rc:hover { transform: scale(1.02); }
.mc-rc.hl {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-color: #c7d2fe;
}
.mc-rl {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    margin-bottom: .35rem;
}
.mc-rc.hl .mc-rl { color: #4338ca; }
.mc-rv {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
}
.mc-rc.hl .mc-rv { color: #4338ca; font-size: 1.6rem; }
.mc-sr { display: flex; gap: .5rem; }
.mc-sb {
    flex: 1;
    padding: .7rem;
    border-radius: 10px;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    transition: transform .15s, opacity .15s;
}
.mc-sb:hover { transform: translateY(-1px); opacity: .92; }
.mc-sb:active { transform: scale(.96); }
.mc-wa { background: #25D366; color: #fff; }
.mc-cp { background: #f1f3f9; color: #374151; }
.mc-err {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: .65rem 1rem;
    font-size: .85rem;
    color: #dc2626;
    font-weight: 500;
    text-align: center;
    margin-bottom: .75rem;
    display: none;
}
.mc-err.show { display: block; }

@media (max-width: 480px) {
    .mc-body { padding: 1.25rem 1.25rem; }
    .mc-head { padding: 1.5rem 1.25rem; }
    .mc-res { padding: 1rem 1.25rem 1.5rem; }
    .mc-rv { font-size: 1.2rem; }
    .mc-rc.hl .mc-rv { font-size: 1.4rem; }
}
