/* ===== Custom Styling ===== */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
}

.btn-sm {
    margin: 0 2px;
}

.table-hover tbody tr:hover {
    background-color: #f5f5f5;
}

.pagination {
    justify-content: center;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn-primary:hover {
    background-color: #0b5ed7;
}

.badge {
    padding: 0.35rem 0.65rem;
    font-weight: 500;
}

.alert {
    border-radius: 8px;
    border: none;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8f9fa;
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
}

/* Search bar styling */
.search-container {
    position: relative;
}

.search-container input {
    padding-right: 40px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    border-radius: 0 0 4px 4px;
}

.search-result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Action buttons styling */
.action-buttons {
    white-space: nowrap;
}

.btn-view {
    background-color: #0d6efd;
    color: white;
}

.btn-view:hover {
    background-color: #0b5ed7;
    color: white;
}

.btn-edit {
    background-color: #ffc107;
    color: black;
}

.btn-edit:hover {
    background-color: #e0a800;
    color: black;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

.btn-delete:hover {
    background-color: #bb2d3b;
    color: white;
}

/* Form styling */
.form-label {
    font-weight: 600;
    margin-top: 1rem;
}

.required::after {
    content: " *";
    color: #dc3545;
}

/* Loading spinner */
.spinner-container {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner-container.active {
    display: block;
}

footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

@media (max-width: 768px) {
    .table {
        font-size: 0.85rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .action-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
}
