/* Modern Dark Theme - Neon Accents */
:root {
    /* Color Palette */
    --bg-dark: #0f111a;
    /* Deep midnight blue/black */
    --bg-card: #1a1d2d;
    /* Slightly lighter for cards */
    --bg-input: #23273a;

    --text-primary: #e0e0e0;
    /* High readability white */
    --text-secondary: #a0a0b0;

    /* Neon Accents */
    --neon-purple: #b026ff;
    --neon-blue: #00e5ff;
    --gradient-primary: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));

    /* Status Colors */
    --success: #00ff9d;
    --warning: #ffbf00;
    --danger: #ff5252;

    /* Spacing & Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 15px rgba(176, 38, 255, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    /* High readability */
    font-size: 18px;
    /* Increased for 50+ readability */
    line-height: 1.6;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    /* Montenegro Night Gradient (Deep Sea & Mountains) */
    background-image: linear-gradient(160deg, #02050a 0%, #0f1c2e 50%, #1a0b2e 100%);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #fff;
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
    color: var(--neon-blue);
}

a {
    color: var(--neon-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--neon-purple);
    text-shadow: 0 0 8px rgba(176, 38, 255, 0.4);
}

/* Layout */
.navbar {
    background: rgba(26, 29, 45, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    width: 100%;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(176, 38, 255, 0.3);
}

.nav-links a {
    color: var(--text-primary);
    margin-left: 2rem;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: var(--neon-purple);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
}

/* Cards & Containers */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: var(--neon-purple);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn.primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(176, 38, 255, 0.3);
}

.btn.primary:hover {
    box-shadow: 0 6px 20px rgba(176, 38, 255, 0.5);
    transform: translateY(-1px);
    color: white;
}

.btn.secondary {
    background: transparent;
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
}

.btn.secondary:hover {
    background: rgba(0, 229, 255, 0.1);
    color: white;
    border-color: white;
}

.btn.danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn.danger:hover {
    background: rgba(255, 82, 82, 0.1);
}


/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(176, 38, 255, 0.1);
    color: var(--neon-blue);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Badges */
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge.success,
.badge.paid,
.badge.electricity {
    background: rgba(0, 255, 157, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge.warning,
.badge.unpaid,
.badge.water {
    background: rgba(255, 191, 0, 0.15);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.badge.danger,
.badge.deleted {
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.badge.admin {
    background: rgba(176, 38, 255, 0.15);
    color: var(--neon-purple);
    border: 1px solid var(--neon-purple);
}

/* Meter Readings History specific */
.meter-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.reading-history-table th {
    background: rgba(0, 229, 255, 0.1);
    color: var(--neon-blue);
}

.reading-valid {
    color: var(--success);
}

.reading-invalid {
    color: var(--danger);
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Two equal columns on desktop */
    gap: 2rem;
    align-items: start;
}

/* Bill List Styles */
.bill-list {
    list-style: none;
    padding: 0;
}

.bill-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.bill-item:hover {
    border-color: var(--neon-blue);
    background: rgba(255, 255, 255, 0.05);
}

.bill-info {
    display: flex;
    flex-direction: column;
}

.bill-date {
    font-weight: 600;
    color: white;
}

.bill-amount {
    color: var(--neon-blue);
    font-size: 1.1rem;
    font-weight: bold;
}

.bill-details-mini {
    margin-right: auto;
    margin-left: 2rem;
    text-align: left;
}

/* Responsive Dashboard */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        /* Stack on smaller screens */
    }
}

/* Flash Message Modal */
.flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.flash-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), var(--shadow-glow);
    animation: zoomIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.flash-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.flash-close:hover {
    color: white;
}

.flash-content {
    margin-bottom: 1.5rem;
}

.flash-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.5rem 0;
}

.flash-icon {
    font-size: 1.5rem;
    margin-top: 0.2rem;
}

.text-error {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.text-info {
    color: var(--neon-blue);
}

.flash-text {
    font-size: 1.1rem;
    line-height: 1.5;
    color: white;
}

.flash-footer {
    display: flex;
    justify-content: flex-end;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .navbar {
        flex-direction: column;
        padding: 1rem;
    }

    .nav-links {
        margin-top: 1rem;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .nav-links a {
        margin: 0;
    }

    .card {
        padding: 1.5rem;
    }
}

footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer a:hover {
    text-decoration: underline;
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.5);
}

/* Icon Buttons */
.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin: 0 0.2rem;
}

.btn-icon.success {
    color: var(--success);
}

.btn-icon.success:hover {
    background: rgba(0, 255, 157, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
}

.btn-icon.danger {
    color: var(--danger);
}

.btn-icon.danger:hover {
    background: rgba(255, 82, 82, 0.1);
    box-shadow: 0 0 10px rgba(255, 82, 82, 0.3);
}

/* Landing Page Hero */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.cta-buttons {
    margin-top: 30px;
    /* Precise 30px spacing as requested */
    display: flex;
    justify-content: center;
}

.cta-buttons .btn {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
}

/* Status Badges (New) */
.status-badge {
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
    letter-spacing: 0.5px;
}

.status-badge.paid {
    background: rgba(0, 255, 157, 0.2);
    color: #00ff9d;
    /* Bright Green */
    border: 1px solid rgba(0, 255, 157, 0.3);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.1);
}

.status-badge.unpaid {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
    /* Bright Red */
    border: 1px solid rgba(255, 82, 82, 0.3);
    box-shadow: 0 0 10px rgba(255, 82, 82, 0.1);
}

/* Inline Checkbox Style */
.checkbox-inline {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.5rem;
    width: auto !important;
    margin-top: 1rem;
}

.checkbox-inline input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    min-height: unset !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
    cursor: pointer;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    /* Small radius for checkbox */
    appearance: none;
    /* Custom style to match theme */
    -webkit-appearance: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-inline input[type="checkbox"]:checked {
    background: var(--neon-blue);
    border-color: var(--neon-blue);
}

.checkbox-inline input[type="checkbox"]:checked::after {
    content: '✔';
    color: #000;
    font-size: 14px;
    font-weight: bold;
}