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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="text"], 
input[type="number"], 
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus, 
input[type="number"]:focus, 
select:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button[type="submit"], 
.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

button[type="submit"]:hover, 
.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

.secondary-btn:hover {
    background: #e9ecef;
}

.cancel-btn {
    background: #dc3545;
    color: white;
}

.cancel-btn:hover {
    background: #c82333;
}

#add-user {
    background: #28a745;
    color: white;
    margin-top: 10px;
}

#add-user:hover {
    background: #218838;
}

.user-input {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.user-input input {
    flex: 1;
    margin-right: 10px;
}

.remove-user {
    background: #dc3545;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding: 0;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.event-actions {
    display: flex;
    gap: 10px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e1e5e9;
    margin-bottom: 30px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.expenses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.expenses-total {
    text-align: right;
    font-size: 16px;
    font-weight: 600;
    color: #555;
    margin-bottom: 15px;
}

#add-expense-btn {
    background: #28a745;
    color: white;
}

#add-expense-btn:hover {
    background: #218838;
}

.expense-item, .balance-item, .settlement-item {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.expense-details h4 {
    margin-bottom: 5px;
    color: #333;
}

.expense-meta {
    color: #666;
    font-size: 14px;
}

.expense-amount {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.expense-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.expense-buttons {
    display: flex;
    gap: 8px;
}

.edit-expense-btn, .delete-expense-btn {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 6px;
    font-weight: 500;
}

.edit-expense-btn {
    background: #007bff;
    color: white;
}

.edit-expense-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.delete-expense-btn {
    background: #dc3545;
    color: white;
}

.delete-expense-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.balance-positive {
    color: #28a745;
}

.balance-negative {
    color: #dc3545;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
    margin: 0;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal-content form {
    padding: 30px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.modal-actions button {
    flex: 1;
}

.split-user {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.split-user input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
}

.link-container {
    display: flex;
    gap: 10px;
}

.link-container input {
    flex: 1;
}

#copy-link-btn {
    background: #007bff;
    color: white;
    white-space: nowrap;
}

#copy-link-btn:hover {
    background: #0056b3;
}

.help-text {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .event-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .event-actions {
        width: 100%;
        justify-content: center;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 100px;
    }
    
    .expense-item, .balance-item, .settlement-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}