/* File: assets/css/admin.css */
:root {
    --admin-primary: #1e293b;
    --admin-secondary: #e53935;
    --admin-bg: #f1f5f9;
    --admin-text: #334155;
    --white: #ffffff;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
}

/* Login Page Specific */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05); /* Modern soft shadow, no hard borders */
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--admin-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    outline: none;
    transition: all var(--transition-speed);
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--admin-secondary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background var(--transition-speed);
}

.btn-primary:hover {
    background: #c62828;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--admin-primary);
    color: var(--white);
    padding: 20px 0;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-speed);
}

.sidebar-header {
    padding: 0 20px 20px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-links {
    list-style: none;
    margin-top: 20px;
}

.nav-links li a {
    display: block;
    padding: 15px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all var(--transition-speed);
}

.nav-links li a:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-header {
    background: var(--white);
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: flex-end;
}

.logout-btn {
    text-decoration: none;
    background: var(--admin-secondary);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.content-body {
    padding: 30px;
}

/* Sidebar SVG Icons Styling */
.nav-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all var(--transition-speed);
}

.nav-links li a svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Mobile Hamburger & Overlay */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--admin-primary);
}

.menu-toggle svg {
    width: 28px;
    height: 28px;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 20px;
}

.sidebar-close svg {
    width: 24px;
    height: 24px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Advanced Responsive & Off-Canvas Rules */
@media (max-width: 768px) {
    .menu-toggle {
        display: block; /* Show hamburger on mobile */
    }
    
    .sidebar-close {
        display: block; /* Show close button on mobile sidebar */
    }

    .top-header {
        justify-content: space-between; /* Space between hamburger and logout */
        align-items: center;
    }

    /* Off-Canvas Sidebar Setup */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* Hidden by default */
        width: 280px;
        height: 100vh;
        z-index: 1000;
        overflow-y: auto;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* When active, slide in */
    .sidebar.active {
        left: 0;
    }

    /* Overlay active state */
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* Table & Form Styles for Manage Donors */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h2 {
    color: var(--admin-primary);
}

.card {
    background: var(--white);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

/* Responsive Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.admin-table th, .admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table th {
    background-color: #f8fafc;
    color: var(--admin-primary);
    font-weight: 600;
}

.admin-table tbody tr:hover {
    background-color: #f1f5f9;
}

.badge {
    padding: 5px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: bold;
}

.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-blood { background: #fee2e2; color: #dc2626; }

/* Grid Form Layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

/* Dashboard Analytics Styles */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: var(--white);
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04); /* Soft shadow, no borders */
    text-align: center;
    transition: transform var(--transition-speed);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 36px;
    color: var(--admin-primary);
    margin-bottom: 5px;
    line-height: 1;
}

.stat-card p {
    color: #64748b;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card.active-donors h3 { color: #16a34a; }
.stat-card.inactive-donors h3 { color: #dc2626; }

/* Blood Group Breakdown Grid */
.bg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.bg-card {
    background: #f8fafc;
    padding: 20px 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.bg-card h4 {
    font-size: 24px;
    color: var(--admin-secondary);
    margin-bottom: 5px;
}

.bg-card span {
    font-size: 16px;
    color: var(--admin-text);
    font-weight: bold;
}