/* Water Management System - Custom Styles */

/* Custom color variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Hero section styling */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    /* allow clicks through the decorative overlay so buttons remain clickable */
    pointer-events: none;
}

/* Card styling */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: none;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

/* Border left styling for statistics cards */
.border-left-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-left-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.border-left-info {
    border-left: 4px solid var(--info-color) !important;
}

.border-left-danger {
    border-left: 4px solid var(--danger-color) !important;
}

.border-left-secondary {
    border-left: 4px solid var(--secondary-color) !important;
}

/* Text styling */
.text-xs {
    font-size: 0.7rem;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.text-gray-800 {
    color: #2d3748 !important;
}

.text-gray-300 {
    color: #cbd5e0 !important;
}

/* Button styling */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Navigation styling */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.nav-link:hover {
    color: rgba(255,255,255,0.8) !important;
}

/* Sidebar styling */
/* Modern left sidebar to match app screenshots */
.sidebar {
    background-color: #f7f9fc;
    border-right: 1px solid #e6ecf3;
}

.sidebar .nav-link,
.sidebar .nav-link:link,
.sidebar .nav-link:visited {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151 !important; /* force neutral, avoid default blue */
    font-weight: 600;
    padding: 0.75rem 1rem;
    margin: 0.125rem 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar .nav-link i {
    color: #6b7280; /* gray-500 icons */
    width: 1.25rem;
    text-align: center;
}

.sidebar .nav-link:hover {
    background-color: rgba(13, 110, 253, 0.08); /* subtle blue hover */
    color: #0d6efd !important; /* blue text on hover */
    transform: translateX(3px);
}

.sidebar .nav-link:hover i {
    color: #0d6efd; /* blue icon on hover */
}

/* Active/current page should NOT become a blue pill; keep neutral like dashboard */
.sidebar .nav-link.active,
.sidebar .nav-link:focus,
.sidebar .nav-link:active {
    background-color: transparent;
    color: #111827 !important; /* keep dark text */
    outline: none;
}

.sidebar .nav-link.active i,
.sidebar .nav-link:focus i,
.sidebar .nav-link:active i {
    color: #6b7280; /* keep gray icon */
}

.sidebar-heading {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Table styling */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Badge styling */
.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
    border-radius: 0.375rem;
}

/* Alert styling */
.alert {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Form styling */
.form-control {
    border-radius: 0.5rem;
    border: 2px solid #e9ecef;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
    border-radius: 0.5rem 0 0 0.5rem;
    border: 2px solid #e9ecef;
    background-color: #f8f9fa;
}

/* Dropdown styling */
.dropdown-menu {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    transition: background-color 0.2s ease-in-out;
}

.dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Footer styling */
footer {
    background: linear-gradient(135deg, #212529 0%, #343a40 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .fas {
        font-size: 8rem !important;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-in-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Water drop icon animation */
.water-drop {
    animation: waterDrop 2s ease-in-out infinite;
}

@keyframes waterDrop {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.1);
    }
}

/* Chart container styling */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Statistics card hover effects */
.stat-card {
    transition: all 0.3s ease-in-out;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Notification styling */
.notification-item {
    transition: background-color 0.2s ease-in-out;
}

.notification-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Meter reading card styling */
.meter-reading-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--info-color);
}

/* Bill status styling */
.bill-status-unpaid {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning-color);
}

.bill-status-overdue {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 4px solid var(--danger-color);
}

.bill-status-paid {
    background-color: rgba(25, 135, 84, 0.1);
    border-left: 4px solid var(--success-color);
}

/* Payment method badges */
.payment-method-cash {
    background-color: var(--success-color);
}

.payment-method-bank_transfer {
    background-color: var(--info-color);
}

.payment-method-online {
    background-color: var(--primary-color);
}

.payment-method-check {
    background-color: var(--secondary-color);
}
