/* Custom Bootstrap Styling */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
}

body {
    background-color: #f5f7fa;
    color: #333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-header h5 {
    color: white;
    font-weight: 700;
    font-size: 18px;
    margin: 0;
}

.sidebar .nav {
    padding: 15px 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-left-color: white;
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: auto;
}

/* Main Content Area */
.d-flex {
    display: flex;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
}

.navbar {
    background-color: white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 500;
}

.content-area {
    padding: 2rem;
}

.view-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Dashboard Cards */
.dashboard-card {
    border: none;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.dashboard-card h2 {
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0;
    padding: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table {
    font-size: 14px;
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #e9ecef;
    background-color: #f8f9fa;
    color: var(--dark-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 14px;
}

.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 0.625rem 0.875rem;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-control::placeholder {
    color: #999;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.625rem 1rem;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #5568d3 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white !important;
}

.btn-primary:focus,
.btn-primary:active {
    background-color: #4f5fc4 !important;
    color: white !important;
}

.btn-success {
    background-color: var(--success-color) !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
}

.btn-success:hover {
    background-color: #059669 !important;
    color: white !important;
}

.btn-success:focus,
.btn-success:active {
    background-color: #047857 !important;
    color: white !important;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    color: white;
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-info:hover {
    background-color: #0891b2;
    color: white;
}

.btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-outline-danger:hover {
    background-color: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 13px;
    background-color: white;
}

/* Badges */
.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    border-radius: 6px;
}

/* Modals */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    font-weight: 700;
    color: var(--dark-color);
}

/* Toast Notifications */
.toast {
    background: white;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
}

.toast-header {
    background-color: transparent;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem;
}

.toast-body {
    padding: 1rem;
}

.toast.success .toast-header {
    background-color: #d1fae5;
    color: #065f46;
}

.toast.error .toast-header {
    background-color: #fee2e2;
    color: #7f1d1d;
}

/* Pagination */
.pagination {
    margin-top: 20px;
}

.page-link {
    border-radius: 6px;
    color: var(--primary-color);
    border: 1px solid #e9ecef;
    margin: 0 3px;
    transition: all 0.2s ease;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: fixed;
        height: auto;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        left: 0;
        right: 0;
        z-index: 2000;
    }

    .sidebar.active {
        max-height: 100vh;
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 1rem;
    }

    .dashboard-card h2 {
        font-size: 24px;
    }

    .table {
        font-size: 12px;
    }

    .btn-sm {
        padding: 0.3rem 0.5rem;
        font-size: 12px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading Spinner */
.spinner-border {
    color: var(--primary-color);
}

/* Alert Messages */
.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    color: #7f1d1d;
}

.alert-warning {
    background-color: #fef3c7;
    color: #78350f;
}

.alert-info {
    background-color: #cffafe;
    color: #0c4a6e;
}

/* Utility */
.text-muted {
    color: #6b7280 !important;
}

.border-bottom {
    border-bottom: 1px solid #e9ecef !important;
}

/* Action Buttons */
#addUserBtn,
#addCompartmentBtn {
    background-color: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    visibility: visible !important;
}

#addUserBtn:hover,
#addCompartmentBtn:hover {
    background-color: #5568d3 !important;
    color: white !important;
}
