/* AquaConnect Admin Dashboard CSS */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    transition: all 0.3s;
    z-index: 999;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.1);
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.sidebar-header p {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

.sidebar.collapsed .sidebar-header h3 {
    font-size: 1rem;
}

.sidebar.collapsed .sidebar-header p {
    display: none;
}

/* Sidebar Navigation */
.sidebar ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.sidebar ul li {
    position: relative;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar ul li a:hover,
.sidebar ul li.active > a {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 3px solid var(--primary-color);
}

.sidebar ul li a i {
    min-width: 30px;
    font-size: 1.2rem;
}

.sidebar.collapsed ul li a {
    justify-content: center;
}

.sidebar.collapsed ul li a i {
    margin-right: 0;
}

.sidebar.collapsed ul li a span {
    display: none;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px;
    background: rgba(0,0,0,0.2);
}

/* Main Content */
#content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s;
}

#content.expanded {
    width: calc(100% - var(--sidebar-collapsed-width));
    margin-left: var(--sidebar-collapsed-width);
}

/* Top Navbar */
.navbar {
    padding: 15px 20px;
    background: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

#sidebarCollapse {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 8px 15px;
}

#sidebarCollapse:hover {
    background: #0056b3;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

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

.border-left-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-left-info {
    border-left: 4px solid var(--info-color) !important;
}

.border-left-warning {
    border-left: 4px solid var(--warning-color) !important;
}

/* Statistics Cards */
.text-xs {
    font-size: 0.7rem;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

/* Tables */
.table {
    color: #858796;
}

.table thead th {
    background-color: #f8f9fc;
    border-bottom: 2px solid #e3e6f0;
    color: #5a5c69;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length select {
    padding: 5px 30px 5px 10px;
    border-radius: 5px;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 5px;
    padding: 5px 10px;
    margin-left: 10px;
}

.page-link {
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Status Badges */
.badge {
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 5px;
}

.badge-success {
    background-color: #1cc88a;
}

.badge-warning {
    background-color: #f6c23e;
}

.badge-danger {
    background-color: #e74a3b;
}

.badge-info {
    background-color: #36b9cc;
}

.badge-secondary {
    background-color: #858796;
}

/* Buttons */
.btn {
    border-radius: 5px;
    font-size: 0.9rem;
    padding: 8px 16px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Login Modal */
.modal-content {
    border-radius: 10px;
    border: none;
}

.modal-header {
    border-radius: 10px 10px 0 0;
    border: none;
}

/* Charts */
canvas {
    max-height: 300px;
}

/* Pending Actions List */
.list-group-item {
    border: none;
    border-bottom: 1px solid #e3e6f0;
    padding: 15px;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: #f8f9fc;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-content {
    animation: fadeIn 0.5s ease-in-out;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        margin-left: -var(--sidebar-width);
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    #content {
        width: 100%;
        margin-left: 0;
    }
    
    .card {
        margin-bottom: 15px;
    }
}

/* Loading Spinner */
.spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2em;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Notification Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

/* Custom Checkbox */
.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Action Buttons in Tables */
.btn-action {
    padding: 3px 8px;
    font-size: 0.8rem;
    margin: 0 2px;
}

/* Settings Form */
.settings-group {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fc;
    border-radius: 8px;
}

.settings-group h5 {
    margin-bottom: 15px;
    color: #5a5c69;
    font-weight: 600;
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.08);
}

/* Dark Mode (Future Enhancement) */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .card {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .table {
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background-color: #2a2a2a !important;
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .filter-section {
        display: none !important;
    }
    
    #content {
        width: 100% !important;
        margin-left: 0 !important;
    }
}