:root {
    --primary-color: #CC232A;
    --secondary-color: #F5AC27;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --info-color: #7209b7;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --border-radius: 12px;
    --box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: linear-gradient(33deg, #FFD84B 0%, #CC232A 100%);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.5;
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    font-weight: 700;
}

header .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.main-content {
    padding: 30px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.col {
    flex: 1;
    min-width: 320px;
}

.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef2ff;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--box-shadow);
    transform: translateY(-5px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eef2ff;
}

.card h2, .card h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.form-section h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--gray-color);
    font-style: italic;
}

.participant-row {
    margin-bottom: 15px;
}

.participant-row .form-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 0;
}

.participant-input {
    flex: 1;
}

.btn-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-remove:hover {
    background: #d1145a;
    transform: scale(1.1);
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.item-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e2e8f0;
}

.item-header h4 {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
}

.item-total {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.participant-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-item label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--success-color) 0%, #4895ef 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 201, 240, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 201, 240, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #b5179e 100%);
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f8f9ff;
    color: var(--gray-color);
    text-decoration: none;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

.preview-section {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef2ff 100%);
    border-radius: 10px;
    border: 2px dashed var(--primary-color);
}

.preview-summary {
    margin-bottom: 20px;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.preview-row.total {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    border-top: 2px solid var(--primary-color);
    margin-top: 10px;
    padding-top: 15px;
}

.preview-row.discount {
    color: var(--danger-color);
}

.preview-participants {
    margin-top: 20px;
}

.preview-participants h4 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.preview-participant {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.transactions-list {
    max-height: 800px;
    overflow-y: auto;
    padding-right: 10px;
}

.transaction-item {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #eef2ff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.transaction-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.transaction-header h4 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    flex: 1;
    margin-right: 15px;
}

.transaction-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eef2ff;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--gray-color);
}

.transaction-summary {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef2ff 100%);
    border-radius: 10px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-item {
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.summary-label {
    display: block;
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 5px;
}

.summary-value {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.summary-item.highlight .summary-value {
    color: var(--danger-color);
}

.summary-item.total {
    background: var(--primary-color);
    color: white;
}

.summary-item.total .summary-label,
.summary-item.total .summary-value {
    color: white;
}

.participants-details {
    margin-top: 25px;
}

.participants-details h5 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.participant-detail {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #eef2ff;
}

.participant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2ff;
}

.participant-header h6 {
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.participant-total {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.items-table th {
    background: #f8f9ff;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-color);
    border-bottom: 2px solid #eef2ff;
}

.items-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eef2ff;
}

.items-table tr:last-child td {
    border-bottom: none;
}

.discount-row td {
    color: var(--danger-color);
    font-weight: bold;
}

.total-row {
    background: #f8f9ff;
    font-weight: bold;
}

.total-row td {
    padding-top: 15px;
    border-top: 2px solid #eef2ff;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-color);
}

.empty-icon {
    margin-bottom: 25px;
    color: #dbeafe;
}

.empty-state h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
    font-weight: 600;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

footer {
    text-align: center;
    padding: 25px;
    color: var(--gray-color);
    border-top: 1px solid #eef2ff;
    background: #f8f9ff;
}

.footer-note {
    font-size: 0.9rem;
    margin-top: 8px;
    color: #adb5bd;
}

/* Responsive */
@media (max-width: 992px) {
    .row {
        flex-direction: column;
    }
    
    .col {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }
    
    .main-content {
        padding: 20px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .participant-checkboxes {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.item-card {
    animation: fadeIn 0.3s ease;
}

.transaction-item {
    animation: fadeIn 0.5s ease;
}

/* Auto-calculate discount warning */
.discount-warning {
    color: var(--warning-color);
    font-size: 0.9rem;
    margin-top: 5px;
    display: none;
}