* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 30px 20px 20px;
    font-size: 2.5em;
    font-weight: 300;
}

.subtitle {
    text-align: center;
    color: rgba(182, 46, 46, 0.9);
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 1.1em;
}

.currency-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 30px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.currency-label {
    color: white;
    font-weight: 500;
    font-size: 1.1em;
}

.currency-select {
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    min-width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.currency-select:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.input-section {
    padding: 30px;
    border-bottom: 1px solid #eee;
}

.input-section:last-child {
    border-bottom: none;
}

h2 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.5em;
    font-weight: 500;
}

.instruction {
    color: #718096;
    margin-bottom: 20px;
    font-size: 1em;
}

.person-input {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.name-input, .amount-input {
    flex: 1;
    min-width: 150px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.name-input:focus, .amount-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-btn, .calculate-btn, .reset-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn {
    background: #48bb78;
    color: white;
    min-width: 120px;
}

.add-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.calculate-btn {
    background: #667eea;
    color: white;
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    font-size: 18px;
}

.calculate-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.reset-btn {
    background: #e53e3e;
    color: white;
    margin-top: 20px;
}

.reset-btn:hover {
    background: #c53030;
    transform: translateY(-2px);
}

.person-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.person-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.person-name {
    font-weight: 500;
    color: #2d3748;
}

.person-amount {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1em;
}

.remove-btn {
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #c53030;
}

.paid-input-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #48bb78;
}

.paid-amount-input {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    width: 120px;
    text-align: right;
}

.paid-amount-input:focus {
    outline: none;
    border-color: #48bb78;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

.paid-amount-input.warning {
    border-color: #e53e3e;
    background-color: #fed7d7;
}

.paid-amount-input.warning:focus {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.calculate-btn:disabled:hover {
    transform: none !important;
}

.results-section {
    padding: 30px;
    background: #f8f9fa;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .person-input {
        flex-direction: column;
    }
    
    .name-input, .amount-input, .add-btn {
        min-width: 100%;
    }
}

.net-balances h3, .transfers h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-weight: 500;
}

.balance-positive {
    background: #c6f6d5;
    color: #22543d;
}

.balance-negative {
    background: #fed7d7;
    color: #742a2a;
}

.balance-zero {
    background: #e2e8f0;
    color: #4a5568;
}

.transfer-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #e6fffa;
    border-radius: 8px;
    border-left: 4px solid #38b2ac;
}

.transfer-arrow {
    margin: 0 10px;
    color: #38b2ac;
    font-weight: bold;
}

.transfer-amount {
    margin-left: auto;
    font-weight: 600;
    color: #234e52;
}

.empty-state {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 20px;
}

.bill-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid #e2e8f0;
}

.bill-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
}

.bill-info:last-child {
    margin-bottom: 0;
    padding-top: 12px;
    border-top: 2px solid #dee2e6;
    font-weight: 600;
}

.bill-label {
    font-weight: 500;
    color: #4a5568;
    font-size: 1.1em;
}

.bill-amount {
    font-weight: 600;
    font-size: 1.2em;
    color: #2d3748;
}

.bill-amount.overpaid {
    color: #e53e3e;
    background: #fed7d7;
    padding: 4px 8px;
    border-radius: 6px;
}

.bill-amount.remaining {
    color: #d69e2e;
}

.bill-amount.complete {
    color: #38a169;
}

.validation-warning {
    background: #fed7d7;
    color: #742a2a;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #e53e3e;
    font-weight: 500;
}