:root {
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f1c40f;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f6fa;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.app-header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

section {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.price-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.total-display {
    background-color: var(--light-color);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-weight: bold;
    text-align: center;
    color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-secondary {
    background-color: var(--light-color);
    color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #357abd;
    transform: translateY(-1px);
}

.btn-secondary:hover {
    background-color: #dde4e6;
}

.search-container {
    margin-bottom: 1rem;
}

.search-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

th {
    background-color: var(--light-color);
    font-weight: 600;
    color: var(--secondary-color);
}

tr:hover {
    background-color: #f8f9fa;
}

.delete-all-container {
    margin-top: 1rem;
    text-align: right;
}

.delete-all-container button {
    background-color: var(--danger-color);
    color: white;
}

.delete-all-container button:hover {
    background-color: #c0392b;
}

@media (max-width: 768px) {
    .container {
        width: 95%;
    }
    
    .price-inputs {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    box-shadow: var(--box-shadow);
}

.notification.success {
    background-color: var(--success-color);
}

.notification.error {
    background-color: var(--danger-color);
}

.notification.info {
    background-color: var(--primary-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Form Validation Styles */
input:invalid {
    border-color: var(--danger-color);
}

input:focus:invalid {
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

/* Table Improvements */
.table-responsive {
    margin-top: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

table {
    background: white;
}

td button {
    margin: 0 0.25rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

td button:first-child {
    background-color: var(--primary-color);
    color: white;
}

td button:last-child {
    background-color: var(--danger-color);
    color: white;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .notification {
        width: 90%;
        right: 5%;
        text-align: center;
    }
    
    td button {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .table-responsive {
        margin: 1rem -1rem;
        border-radius: 0;
    }
}