/* ============================================
   ENHANCED CALCULATOR DESIGN
   ============================================ */

/* Glass Calculator Card */
.calculator-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 20px 50px -12px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(124, 58, 237, 0.05);
    border-radius: 24px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 900px;
    margin: 0 auto;
}

.calculator-container:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(124, 58, 237, 0.1);
}

/* Modern Header with Steps */
.calculator-header {
    background: linear-gradient(to right, #f8fafc, #ffffff);
    padding: 2.5rem 2rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    position: relative;
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

/* Connecting Line */
.step-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #e2e8f0;
    z-index: 0;
    border-radius: 10px;
}

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

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

.step-number {
    width: 44px;
    height: 44px;
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 14px; /* Squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #94a3b8;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(124, 58, 237, 0.3);
}

.step.completed .step-number {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.step-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    transition: color 0.3s ease;
}

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

/* Stylish Input Groups */
.modern-input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.modern-input-group input,
.modern-input-group select {
    width: 100%;
    padding: 1.2rem 1rem 1.2rem 3.5rem;
    font-size: 1rem;
    color: var(--gray-800);
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.modern-input-group input:focus,
.modern-input-group select:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
    outline: none;
}

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

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

/* Floating label effect placeholder override */
.modern-input-group input::placeholder {
    color: #cbd5e1;
}

/* Action Buttons */
.action-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 16px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

/* People Chips Redesign */
.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.modern-person-chip {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.modern-person-chip:hover {
    border-color: var(--primary-light);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.avatar-circle {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.chip-name {
    font-weight: 500;
    color: var(--gray-700);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-chip {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #fee2e2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.modern-person-chip:hover .delete-chip {
    opacity: 1;
    transform: scale(1);
}

/* Expense Items Redesign */
.modern-expense-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modern-expense-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.modern-expense-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.expense-icon {
    width: 40px;
    height: 40px;
    background: #f0fdf4; /* Green tint */
    color: var(--secondary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.expense-details h4 {
    margin: 0;
    color: var(--gray-800);
    font-size: 1rem;
}

.expense-details p {
    margin: 0;
    color: var(--gray-500);
    font-size: 0.85rem;
}

.expense-amount-tag {
    background: #f8fafc;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    color: var(--gray-800);
}

/* Results Area */
.settlement-card {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 2rem;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

.settlement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.result-item:last-child {
    border-bottom: none;
}

.transfer-arrow {
    color: #cbd5e1;
    font-size: 0.9rem;
    margin: 0 1rem;
}

.money-badge {
    background: var(--secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

/* Empty States */
.modern-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed #e2e8f0;
    margin-top: 1.5rem;
}

.modern-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.4s ease forwards;
}

/* Enhanced Currency Selector */
.currency-dropdown-container {
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2e8f0;
}

/* ============================================
   MOBILE RESPONSIVE - CALCULATOR
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .calculator-container {
        max-width: 100%;
    }

    .people-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .modern-expense-item {
        grid-template-columns: auto 1fr auto;
    }
}

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

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

    /* Fix for Add Person button */
    .add-person-form .btn-primary {
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
        min-height: 48px;
        width: 100%;
    }

    /* Fix for Add Expense button */
    .expense-form-card .btn-primary {
        padding: 1.1rem 1.5rem !important;
        font-size: 1rem !important;
        min-height: 50px;
    }

    .step-indicator::before {
        left: 35px;
        right: 35px;
        top: 18px;
        height: 2px;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        border-width: 2.5px;
    }

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

    .modern-input-group input,
    .modern-input-group select {
        padding: 1rem 1rem 1rem 3rem;
    }

    .people-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .modern-person-chip {
        padding: 0.75rem 0.65rem;
    }

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

    .modern-expense-list {
        gap: 0.75rem;
    }

    .modern-expense-item {
        grid-template-columns: auto 1fr auto;
        padding: 0.875rem 0.75rem;
        gap: 0.75rem;
    }

    .expense-icon {
        width: 36px;
        height: 36px;
    }

    .expense-details h4 {
        font-size: 0.9rem;
    }

    .expense-details p {
        font-size: 0.8rem;
    }

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

    /* All action buttons on mobile */
    .btn-secondary,
    .btn-outline {
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
        min-height: 48px;
    }

    .settlement-card {
        padding: 1.5rem 1rem;
    }

    .result-item {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        padding: 1rem 0.75rem;
    }

    .result-item > div {
        width: 100%;
        justify-content: center;
    }

    .money-badge {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}

/* Very Small Mobile */
@media (max-width: 480px) {
    .calculator-header {
        padding: 1.5rem 1rem 0.875rem;
    }

    .step-indicator {
        gap: 0.25rem;
    }

    /* Make Add buttons even larger on small screens */
    .add-person-form .btn-primary,
    .expense-form-card .btn-primary {
        padding: 1.15rem 1.5rem !important;
        font-size: 1rem !important;
        min-height: 52px;
        font-weight: 600;
    }

    .btn-primary i,
    .btn-secondary i {
        font-size: 1.1rem;
    }

    .step-indicator::before {
        left: 28px;
        right: 28px;
    }

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

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

    .currency-dropdown-container {
        padding: 0.4rem;
        font-size: 0.85rem;
    }

    .modern-input-group input,
    .modern-input-group select {
        padding: 0.9rem 0.9rem 0.9rem 2.5rem;
        font-size: 0.875rem;
    }

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

    .people-grid {
        grid-template-columns: 1fr;
    }

    .modern-person-chip {
        padding: 0.7rem 0.6rem;
    }

    .avatar-circle {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .expense-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .expense-amount-tag {
        padding: 0.35rem 0.65rem;
        font-size: 0.8rem;
    }

    .delete-chip {
        width: 22px;
        height: 22px;
    }

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

    .settlement-card h2 {
        font-size: 1.4rem !important;
    }

    .settlement-card h4 {
        font-size: 0.9rem;
    }
}

/* Landscape Mode */
@media (max-height: 600px) and (orientation: landscape) {
    .calculator-header {
        padding: 1.25rem 1.5rem 0.75rem;
    }

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

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .modern-person-chip:hover,
    .modern-expense-item:hover,
    .step:hover {
        transform: none;
        box-shadow: none;
        border-color: inherit;
    }

    .delete-chip {
        opacity: 1;
        transform: scale(1);
    }

    /* Larger touch targets */
    .delete-chip {
        min-width: 32px;
        min-height: 32px;
    }

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

