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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #4a5568;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: #718096;
    font-size: 1.1rem;
    font-weight: 400;
}

/* Summary Section */
.summary-section {
    margin-bottom: 30px;
}

.summary-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-item {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.summary-item:hover {
    transform: translateY(-5px);
}

.summary-item i {
    font-size: 2rem;
    padding: 15px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
}

.summary-item h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.summary-item p {
    color: #718096;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Color Classes */
.text-green { color: #48bb78; }
.text-red { color: #f56565; }
.text-yellow { color: #ed8936; }

.status-full { 
    background: #48bb78; 
    color: white; 
}

.status-half { 
    background: #ed8936; 
    color: white; 
}

.status-pending { 
    background: #f56565; 
    color: white; 
}

/* Form Styles */
.form-section, .filter-section, .table-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.form-section h2, .filter-section h2, .table-section h2 {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 600;
}

.payment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #4a5568;
}

.required {
    color: #f56565;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

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

.form-group input.error,
.form-group select.error {
    border-color: #f56565;
}

.form-group small {
    color: #718096;
    font-size: 0.85rem;
    margin-top: 5px;
}

.error-message {
    color: #f56565;
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 20px;
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 400;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-custom::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background: #667eea;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #667eea;
}

.radio-label input[type="radio"]:checked + .radio-custom::before {
    transform: translate(-50%, -50%) scale(1);
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

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

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

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

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-warning {
    background: #ed8936;
    color: white;
}

.btn-warning:hover {
    background: #dd6b20;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    margin-top: 20px;
}

/* Filter Section */
.filter-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
}

.filter-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-group select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
    position: sticky;
    top: 0;
    z-index: 1;
}

tr:hover {
    background: #f7fafc;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

.type-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.type-receive {
    background: #c6f6d5;
    color: #22543d;
}

.type-pay {
    background: #fed7d7;
    color: #742a2a;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #cbd5e0;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.empty-state small {
    font-size: 0.9rem;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #48bb78;
}

.toast.error {
    background: #f56565;
}

.toast.info {
    background: #4299e1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .summary-card {
        grid-template-columns: 1fr;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
    }
    
    .form-section, .filter-section, .table-section {
        padding: 20px;
    }
    
    .summary-item {
        padding: 20px;
    }
    
    .summary-item h3 {
        font-size: 1.5rem;
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }
    
    .table-container {
        font-size: 0.8rem;
    }
    
    .actions {
        gap: 5px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* Animation for table rows */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-row-enter {
    animation: fadeIn 0.3s ease;
}

/* Half Payment Details Styling */
#halfPaymentDetails {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
    margin-top: 10px;
}

#halfPaymentDetails .form-group label {
    color: #667eea;
    font-weight: 600;
}

#remainingAmount {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 600;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
