:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
    --border-radius: 8px;
    --box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    --sidebar-width: 280px;
    --sidebar-min-width: 280px;
    --sidebar-max-width: 280px;
    --sidebar-collapsed-width: 80px;
    --sidebar-header-height: 60px;
    --sidebar-footer-height: 60px;
    --sidebar-item-height: 50px;
    --sidebar-icon-size: 24px;
    --sidebar-font-size: 0.95rem;
    --sidebar-transition: all 0.3s ease;
    --sidebar-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    --sidebar-bg: #1a1a2e;
    --sidebar-hover-bg: #16213e;
    --sidebar-active-bg: #0f3460;
    --sidebar-text: #ffffff;
    --sidebar-icon: #e94560;
    --sidebar-border: #2a2a3e;
}

body {
    background-color: var(--light-bg);
    padding-top: 60px; /* Height of navbar */
}

/* Web Admin Dashboard Styles */

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    width: 100%;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-min-width);
    max-width: var(--sidebar-max-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 60px;
    height: calc(100vh - 60px);
    left: 0;
    z-index: 1000;
    transition: var(--sidebar-transition);
    box-shadow: var(--sidebar-shadow);
    overflow-y: auto;
}

.sidebar-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--sidebar-header-height);
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand i {
    font-size: 1.75rem;
    color: #4ecca3; /* Mint accent color */
}

.sidebar-menu {
    padding: 1rem 0;
    list-style: none;
    margin: 0;
}

.sidebar-item {
    margin: 0.25rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 0.75rem;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-left-color: #4ecca3;
}

.sidebar-link.active {
    background: rgba(78, 204, 163, 0.1);
    color: #ffffff;
    border-left-color: #4ecca3;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    color: #4ecca3;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--sidebar-footer-height);
}

.sidebar-footer button {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
}

.sidebar-footer button:hover {
    color: #ff6b6b; /* Coral red for logout hover */
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-top: 0;
    min-height: calc(100vh - 60px);
    background: #f8f9fa;
    transition: all 0.3s ease;
    padding: 0;
    margin-left: 5%;
    width: 100%;
}

/* Dashboard Header */
.dashboard-header {
    background: white;
    width: 100%;
    margin-left: 5%;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    margin-top: 70px;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 1.75rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-header h1 i {
    color: #4b6cb7;
}

.dashboard-header .btn-primary {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Content Wrapper */
.content-wrapper {
    padding: 0 2rem 2rem;
}

/* Dashboard Container */
.dashboard-container {
    padding: 1rem;
    min-height: 100vh;
    background-color: #f8f9fa;
    width: 100%;
    margin-left: 0;
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: white;
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.welcome-section h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.welcome-section .lead {
    font-size: 1.2rem;
    opacity: 0.9;
}

.welcome-section .btn-light {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.welcome-section .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Quick Stats Cards */
.stats-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4b6cb7, #182848);
}

.stats-card .card-title {
    color: #6c757d;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-card .card-title i {
    font-size: 1.25rem;
    color: #4b6cb7;
}

.stats-card .stats-value {
    font-size: 2.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.stats-card .stats-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

.stats-card .stats-icon {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    opacity: 0.1;
    color: #4b6cb7;
}

/* Specific Stats Card Styles */
.stats-card.schools::before {
    background: linear-gradient(90deg, #4b6cb7, #182848);
}

.stats-card.services::before {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.stats-card.updated::before {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.stats-card.schools .card-title i {
    color: #4b6cb7;
}

.stats-card.services .card-title i {
    color: #2ecc71;
}

.stats-card.updated .card-title i {
    color: #e74c3c;
}

/* Schools Grid */
.schools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.school-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.school-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.school-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.school-card .card-body {
    padding: 1.5rem;
}

.school-card .card-title {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.school-card .card-text {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.school-services {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.service-badge {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.service-badge i {
    font-size: 0.9rem;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 1rem 1rem 0 0;
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: #2c3e50;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1.5rem;
}

.form-label {
    font-weight: 500;
    color: #495057;
}

.form-control {
    border-radius: 0.5rem;
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: #4b6cb7;
    box-shadow: 0 0 0 0.2rem rgba(75, 108, 183, 0.25);
}

.form-check-input:checked {
    background-color: #4b6cb7;
    border-color: #4b6cb7;
}

.modal-image-preview {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #4b6cb7;
    border-color: #4b6cb7;
}

.btn-primary:hover {
    background: #182848;
    border-color: #182848;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background: #495057;
    border-color: #495057;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Mobile Sidebar Toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: #1a1a2e;
    color: #ffffff;
    border: none;
    padding: 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle:hover {
    background: #232342;
}

/* Responsive Sidebar */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-max-width);
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .sidebar-toggle {
        display: block;
    }

    .dashboard-container {
        padding: 1rem;
    }

    .navbar {
        padding: 0.5rem 1rem;
    }

    .navbar-brand img {
        height: 30px;
    }

    .btn-outline-light {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (min-width: 769px) {
    .sidebar-toggle {
        display: none;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Alert Messages */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Navbar Styles */
.navbar {
    height: 60px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1030; /* Above sidebar */
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand img {
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-left: 0.5rem;
}

.btn-outline-light {
    border-width: 2px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 0;
    }

    .dashboard-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .content-wrapper {
        padding: 0 1rem 1rem;
    }

    .dashboard-container {
        padding: 1rem;
        max-width: 100% !important;
        margin-left: 0;
    }
}

@media (min-width: 993px) {
    .dashboard-container {
        padding: 1rem;
        margin-left: 0;
    }
}

/* Update sidebar menu items for better spacing with wider sidebar */
.sidebar-menu .nav-item {
    padding: 0.5rem 1.5rem;
}

.sidebar-menu .nav-link {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: var(--sidebar-font-size);
    color: var(--sidebar-text);
    transition: var(--sidebar-transition);
    border-radius: 8px;
    margin: 0.25rem 0;
}

.sidebar-menu .nav-link i {
    font-size: var(--sidebar-icon-size);
    min-width: var(--sidebar-icon-size);
    color: var(--sidebar-icon);
}

/* Update sidebar header for wider sidebar */
.sidebar-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--sidebar-header-height);
}

/* Update sidebar footer for wider sidebar */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--sidebar-footer-height);
}

/* Mobile Sidebar Active State */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }

    .sidebar.active + .main-content {
        margin-left: var(--sidebar-width);
    }
}

/************************************************************************************************/
/* Add overlay for mobile sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

@media (max-width: 768px) {
    .sidebar.active + .sidebar-overlay {
        display: block;
    }
}

/* User Info Styles */
.sidebar-user {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info i {
    font-size: 2rem;
    color: #3498db;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: white;
    font-size: 1rem;
}

.user-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    text-transform: capitalize;
}

/* Welcome Section Styles */
.welcome-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.welcome-section h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.welcome-section .lead {
    color: #7f8c8d;
    margin-bottom: 0;
}

/* Dashboard Container */
.dashboard-container {
    padding: 2rem;
    min-height: 100vh;
    background-color: #f8f9fa;
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .welcome-section {
        padding: 1.5rem;
    }

    .welcome-section h1 {
        font-size: 2rem;
    }
}
