/* Smart Bill - Main Stylesheet */

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 30px;
}

/* Header & Navigation */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

nav {
    margin-left: auto;
    margin-right: 2rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    justify-content: flex-end;
    margin-bottom: 0;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

nav li.active > a {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    padding: 6px 10px;
    font-weight: 700;
}

.admin-submenu li.active > a {
    background: #eef1ff;
    color: #2c3e50 !important;
    border-radius: 4px;
}

/* Admin Menu Dropdown */
.admin-menu-item {
    position: relative;
}

.admin-menu-item > a {
    display: flex;
    align-items: center;
}

.admin-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    list-style: none;
    padding: 1rem 0;
    border-radius: 0 0 5px 5px;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
}

.admin-menu-item:hover .admin-submenu {
    display: block;
}

.admin-submenu li {
    padding: 0.5rem 1rem;
}

.admin-submenu a {
    color: white;
    text-decoration: none;
    display: block;
    white-space: nowrap;
}

.admin-submenu a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Authentication Section */
.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.user-info .username {
    font-weight: 500;
    font-size: 0.95rem;
    color: white;
}

.user-info .nav-profile-pic {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    max-width: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 0px solid rgba(255, 255, 255, 0.8);
    display: inline-block;
    vertical-align: middle;
}

.user-info .nav-profile-fallback {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.75);
    vertical-align: middle;
}

.btn-logout {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border: 1px solid white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background-color: white;
    color: #667eea;
}

.auth-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-links .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9)), 
                url('images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 5px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: white;
    color: #667eea;
}

.btn-secondary:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

/* Features/Advantages Section */
.features {
    padding: 80px 0;
    background-color: white;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #667eea;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 10px;
    background: #f8f9fa;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.feature-card p {
    color: #666;
}

/* Forms */
.form-container {
   /* max-width: 500px;*/
    margin: 50px auto;
    padding: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #667eea;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input.valid {
    border-color: #28a745;
}

.form-group input.invalid {
    border-color: #dc3545;
}

.form-link {
    text-align: center;
    margin-top: 1rem;
    color: #666;
}

.form-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.form-link a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
    border-left: 5px solid #667eea;
}

.stat-card h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat-card.individual {
    border-left-color: #28a745;
}

.stat-card.individual .stat-value {
    color: #28a745;
}

/* Tables */
.table-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin: 2rem 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background-color: #667eea;
    color: white;
    font-weight: 600;
}

table tr:hover {
    background-color: #f8f9fa;
}

/* Charts Placeholder */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.chart-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.chart-card h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

.chart-placeholder {
    background: #f8f9fa;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: #999;
    font-style: italic;
}

/* Filters */
.filters {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 0.95rem;
}

/* Page Sections */
.page-section {
    padding: 40px 0;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.page-subtitle {
    color: #666;
    margin-bottom: 2rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin: 10px 0;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

footer p {
    margin: 0;
}

/* Main Content Area */
.body-content {
    padding: 20px 0;
    flex: 1;
}

main {
    min-height: 400px;
}

/* Navigation Bar Overrides */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-size: 1.8rem !important;
    font-weight: bold !important;
}

.nav-link {
    color: white !important;
    transition: opacity 0.3s;
}

.nav-link:hover {
    opacity: 0.8 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    nav ul {
        gap: 1rem;
    }
}

/* Admin Panel Styles */
.admin-panel {
    padding: 20px 0;
}

.admin-panel h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 28px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.admin-table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-table .table {
    margin: 0;
}

.admin-table .table thead {
    background-color: #2c3e50;
    color: white;
}

.admin-table .table thead th {
    border: none;
    padding: 12px 15px;
    font-weight: 600;
}

.admin-table .table tbody tr:hover {
    background-color: #ecf0f1;
}

.admin-table .table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
}

.admin-table .btn-sm {
    margin-right: 5px;
    margin-bottom: 5px;
}

.admin-form {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-form h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 26px;
}

.admin-form .form-group {
    margin-bottom: 20px;
}

.admin-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.admin-form .form-control {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.admin-form .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
    outline: none;
}

.admin-form .form-control[readonly] {
    background-color: #ecf0f1;
    cursor: not-allowed;
}

.admin-form .btn-block {
    width: 100%;
    padding: 12px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-form .btn-primary {
    background-color: #667eea;
    color: white;
}

.admin-form .btn-primary:hover {
    background-color: #5568d3;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.admin-form .text-danger {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.admin-actions {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.admin-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.admin-actions .btn-primary {
    background-color: #667eea;
    color: white;
}

.admin-actions .btn-primary:hover {
    background-color: #5568d3;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.admin-actions .btn-warning {
    background-color: #f39c12;
    color: white;
}

.admin-actions .btn-warning:hover {
    background-color: #e67e22;
}

.admin-actions .btn-info {
    background-color: #3498db;
    color: white;
}

.admin-actions .btn-info:hover {
    background-color: #2980b9;
}

.admin-actions .btn-danger {
    background-color: #e74c3c;
    color: white;
}

.admin-actions .btn-danger:hover {
    background-color: #c0392b;
}

.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.role-badge {
    display: inline-block;
    padding: 5px 10px;
    background-color: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 5px;
}

.role-badge.admin {
    background-color: #e74c3c;
}

.role-badge.site-officer {
    background-color: #f39c12;
}

.role-badge.guest {
    background-color: #95a5a6;
}
