/* Jal Setu - Pristine Flow Light Theme (Blue & White) */

:root {
    /* Color Palette */
    --bg-light: #f4f8fc;       /* Soft sky blue water tint background */
    --surface-white: #ffffff;   /* Pure white card surfaces */
    --surface-light: #f0f6ff;   /* Soft highlight panels */
    
    /* Brand Colors */
    --primary-color: #0ea5e9;    /* Clean Sky Blue */
    --primary-light: #e0f2fe;   /* Very light water accent background */
    --primary-dark: #0369a1;    /* Deep Ocean Blue */
    --secondary-color: #2563eb;  /* Trustworthy Royal Blue */
    --accent-color: #06b6d4;     /* Fresh Aqua/Cyan */
    --light-accent: #ecfeff;    /* Very soft cyan accent */
    
    /* Semantic Colors */
    --success-color: #0d9488;    /* Fresh Teal */
    --warning-color: #d97706;    /* Clear Amber */
    --danger-color: #e11d48;     /* Bright Crimson Red */
    --info-color: #2563eb;       /* Info Blue */
    
    /* Text Colors - Deep Slate for high-contrast legibility */
    --text-primary: #0f172a;     /* Deep Slate (Main headings) */
    --text-secondary: #334155;   /* Slate Gray (Body paragraphs) */
    --text-muted: #64748b;       /* Cool Slate (Muted metadata/labels) */
    
    /* Shadows - Soft Water-tinted Shadows */
    --shadow-sm: 0 2px 8px rgba(14, 165, 233, 0.04);
    --shadow-md: 0 6px 20px rgba(14, 165, 233, 0.06);
    --shadow-lg: 0 12px 35px rgba(14, 165, 233, 0.1);
    --shadow-xl: 0 20px 50px rgba(14, 165, 233, 0.12);
    
    /* Standardized Sizes - Accessible Touch Targets */
    --card-height: auto;
    --card-min-height: 140px;
    --button-height: 48px;       /* 48px child & mobile friendly click target */
    --button-padding: 0.75rem 1.5rem;
    --card-padding: 1.5rem;

    /* UX Spacing Scale */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */

    /* Typography scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --line-tight: 1.25;
    --line-normal: 1.5;
    --line-relaxed: 1.625;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Touch targets */
    --touch-min: 48px;
}

/* Global Styles */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Roboto', 'Segoe UI', sans-serif;
    background-color: var(--bg-light);
    min-height: 100vh;
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
    position: relative;
}

/* Accent Water Waves Background Pattern (Subtle) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.03) 0%, transparent 35%),
        radial-gradient(circle at 85% 75%, rgba(37, 99, 235, 0.02) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    margin-top: 0;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Navigation - Clean Pure White Bar */
.navbar {
    background-color: var(--surface-white) !important;
    box-shadow: 0 2px 12px rgba(14, 165, 233, 0.05) !important;
    border-bottom: 1.5px solid rgba(14, 165, 233, 0.12) !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 1.5rem;
}

.navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--secondary-color) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand::before {
    content: '💧';
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 600;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    margin: 0 0.15rem;
    font-size: 0.95rem;
    color: var(--text-secondary) !important;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary-dark) !important;
}

/* Accessible Cards - White with light blue accent border */
.card {
    border: 1.5px solid rgba(14, 165, 233, 0.12);
    border-top: 4px solid var(--primary-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background-color: var(--surface-white);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-5);
    min-height: var(--card-min-height);
    padding: var(--card-padding);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(14, 165, 233, 0.25);
}

.card-header {
    background-color: var(--surface-light);
    border-bottom: 1.5px solid rgba(14, 165, 233, 0.12);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    font-weight: 700;
    padding: 1.25rem 1.5rem;
    color: var(--primary-dark);
}

.card-body {
    padding: var(--card-padding);
}

/* Analytics & Statistics Cards */
.analytics-card {
    border: 1.5px solid rgba(14, 165, 233, 0.12);
    border-top: 4px solid var(--secondary-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background-color: var(--surface-white);
    transition: all 0.25s ease;
    height: 100%;
    padding: var(--card-padding);
}

.analytics-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(14, 165, 233, 0.25);
}

/* Buttons - Child & Elderly Friendly touch target (48px) */
.btn {
    border-radius: var(--radius-md);
    padding: var(--button-padding);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border: none;
    height: var(--button-height);
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: var(--surface-white) !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
}

.btn-success {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: var(--surface-white) !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.btn-outline-primary {
    border: 1.5px solid var(--primary-color) !important;
    color: var(--primary-dark) !important;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-light);
}

.btn-danger {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    color: var(--surface-white) !important;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--surface-white) !important;
}

/* Forms & Input Elements */
.form-control, .form-select {
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(14, 165, 233, 0.25);
    padding: 0.75rem 1rem;
    background-color: var(--surface-white) !important;
    color: var(--text-primary) !important;
    transition: all 0.2s ease;
    height: var(--button-height);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
    outline: none;
}

.form-label {
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Tables (Light mode water theme) */
.table {
    background-color: var(--surface-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1.5px solid rgba(14, 165, 233, 0.12);
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary) !important;
}

.table thead {
    background-color: var(--primary-light);
    border-bottom: 2px solid rgba(14, 165, 233, 0.2);
}

.table thead th {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    padding: 1rem;
    border: none;
    color: var(--primary-dark) !important;
}

.table tbody tr {
    border-bottom: 1.5px solid rgba(14, 165, 233, 0.08);
}

.table tbody tr:hover {
    background-color: rgba(14, 165, 233, 0.04) !important;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--text-secondary) !important;
}

/* Badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.badge.bg-primary {
    background-color: #eff6ff !important;
    color: #1e40af !important;
    border-color: #bfdbfe;
}
.badge.bg-success {
    background-color: #f0fdf4 !important;
    color: #166534 !important;
    border-color: #bbf7d0;
}
.badge.bg-info {
    background-color: #f0f9ff !important;
    color: #0369a1 !important;
    border-color: #bae6fd;
}
.badge.bg-warning {
    background-color: #fffbeb !important;
    color: #854d0e !important;
    border-color: #fef3c7;
}
.badge.bg-danger {
    background-color: #fff1f2 !important;
    color: #9f1239 !important;
    border-color: #fecdd3;
}

/* Alerts Banner (Clean high-contrast cards) */
.alert {
    border-radius: var(--radius-lg);
    border: 1.5px solid transparent;
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534 !important;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #fef3c7;
    color: #854d0e !important;
}

.alert-info {
    background-color: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1 !important;
}

.alert-danger {
    background-color: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239 !important;
}

/* Progress Bars */
.progress {
    height: 14px;
    border-radius: 10px;
    background-color: #e2e8f0;
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

/* Dropdown Menu styling */
.dropdown-menu {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1.5px solid rgba(14, 165, 233, 0.15);
    background-color: var(--surface-white);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    margin: 0.15rem 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

/* Modal styling */
.modal-content {
    border-radius: var(--radius-xl);
    border: 1.5px solid rgba(14, 165, 233, 0.15);
    box-shadow: var(--shadow-xl);
    background-color: var(--surface-white);
}

.modal-header {
    background-color: var(--surface-light);
    border-bottom: 1.5px solid rgba(14, 165, 233, 0.12);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    color: var(--primary-dark);
}

.modal-footer {
    border-top: 1.5px solid rgba(14, 165, 233, 0.08);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background-color: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* Text Gradient - Cyan-Blue Flow */
.text-gradient {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Empty State UX */
.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-6);
    background-color: var(--surface-light);
    border-radius: var(--radius-lg);
    border: 2px dashed rgba(14, 165, 233, 0.25);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: var(--space-4);
    display: block;
}

.empty-state h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: var(--space-6);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Form Group UX */
.form-group-ux {
    margin-bottom: var(--space-5);
}

.form-label-ux {
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    display: block;
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.form-control:disabled, .form-select:disabled {
    background-color: #f1f5f9 !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    border-color: #cbd5e1 !important;
}

.input-group-text {
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(14, 165, 233, 0.25);
    background-color: var(--surface-light);
    font-weight: 600;
    color: var(--text-secondary);
}

/* Action bar: primary action + secondary actions */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

/* Cards UX */
.card-body-ux {
    padding: var(--space-6);
}

.card-header-ux {
    padding: var(--space-4) var(--space-6);
    font-weight: 700;
    font-size: var(--text-base);
    color: var(--primary-dark);
    background-color: var(--surface-light);
    border-bottom: 1.5px solid rgba(14, 165, 233, 0.12);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Dashboard Statistics widgets */
.stat-card {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-4);
    border-radius: var(--radius-md);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--surface-white);
    line-height: var(--line-tight);
}

.stat-card .stat-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Quick Action Tiles */
.quick-action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1.5px solid rgba(14, 165, 233, 0.15);
    text-align: center;
    background-color: var(--surface-white);
}

.quick-action-tile:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light) !important;
    transform: translateY(-2px);
}

.quick-action-tile .tile-title {
    font-weight: 700;
    font-size: var(--text-base);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.quick-action-tile .tile-sub {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Breadcrumbs */
.breadcrumb-ux {
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
    padding: 0;
    background: none;
}

.breadcrumb-ux .breadcrumb-item a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb-ux .breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-ux .breadcrumb-item.active {
    color: var(--text-muted);
}

/* Detail layout: key-value rows */
.detail-row {
    display: flex;
    padding: var(--space-3) 0;
    border-bottom: 1.5px solid rgba(14, 165, 233, 0.08);
    gap: var(--space-4);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .detail-label {
    font-weight: 700;
    color: var(--text-muted);
    min-width: 140px;
    font-size: var(--text-sm);
}

.detail-row .detail-value {
    color: var(--text-primary);
    font-size: var(--text-sm);
}

/* Mobile & responsive */
@media (max-width: 991px) {
    .navbar-collapse {
        margin-top: var(--space-2);
        padding-top: var(--space-2);
        border-top: 1.5px solid rgba(14, 165, 233, 0.12);
    }
    .nav-link {
        min-width: auto;
        padding: var(--space-3) var(--space-4) !important;
        border-radius: var(--radius-sm);
        margin-bottom: var(--space-1);
    }
}

@media (max-width: 767px) {
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .page-header {
        margin-bottom: var(--space-6);
        padding-bottom: var(--space-3);
    }
    .page-header h1 {
        font-size: var(--text-xl);
    }
    .page-header .lead {
        font-size: var(--text-sm);
    }
    .section-title {
        font-size: var(--text-base);
        margin-bottom: var(--space-3);
    }
    .stat-card {
        min-height: 80px;
        padding: var(--space-3);
    }
    .stat-card .stat-value {
        font-size: var(--text-xl);
    }
    .quick-action-tile {
        min-height: 90px;
        padding: var(--space-3);
    }
    .table-ux thead th, .table-ux tbody td {
        padding: var(--space-3);
        font-size: var(--text-xs);
    }
    .detail-row {
        flex-direction: column;
        gap: var(--space-1);
    }
    .card, .card-body-ux {
        padding: var(--space-4);
    }
    .card-header, .card-header-ux {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.15rem;
    }
    .page-header h1 {
        font-size: var(--text-lg);
    }
}
