@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #f0f9ff;         /* Soft light sky blue */
    --bg-secondary: #ffffff;       /* Pure white card backgrounds */
    --bg-tertiary: #e0f2fe;        /* Very light blue-sky panels */
    --accent-color: #0ea5e9;       /* Main Sky Blue */
    --accent-glow: rgba(14, 165, 233, 0.08);
    --text-primary: #0f172a;       /* Dark slate text */
    --text-secondary: #334155;     /* Muted slate text */
    --text-muted: #64748b;         /* Grey slate text */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --glass-bg: #ffffff;
    --glass-border: rgba(14, 165, 233, 0.18);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Glassmorphism utility card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: 0 4px 20px 0 rgba(14, 165, 233, 0.05);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(14, 165, 233, 0.35);
    box-shadow: 0 8px 30px 0 rgba(14, 165, 233, 0.1), 0 0 15px 0 var(--accent-glow);
}

/* Auth Layout */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
                var(--bg-primary);
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo h2 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 24px;
    text-align: center;
}

.form-control {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.925rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background-color: #ffffff;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.925rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #0284c7 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background-color: #bae6fd;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-color);
    font-weight: 600;
}

/* Alert Styling */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.alert-success {
    background-color: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

/* Main Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 24px;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 8px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-item {
    margin-bottom: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.925rem;
}

.sidebar-link i {
    margin-right: 12px;
    font-size: 1.1rem;
    transition: var(--transition);
}

.sidebar-link:hover, .sidebar-item.active .sidebar-link {
    background-color: var(--accent-glow);
    color: var(--accent-color);
    border-left: 3px solid var(--accent-color);
}

.sidebar-link:hover i, .sidebar-item.active .sidebar-link i {
    color: var(--accent-color);
}

/* Main Content Area */
.main-wrapper {
    flex-grow: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.topbar {
    height: 70px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent-color);
    transition: var(--transition);
}

/* Topbar Avatar Dropdown */
.topbar-avatar-wrapper {
    position: relative;
    cursor: pointer;
}

.topbar-avatar-wrapper:hover .topbar-avatar {
    box-shadow: 0 0 0 3px var(--accent-glow);
    transform: scale(1.03);
}

.avatar-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.08), 0 1px 3px rgba(14, 165, 233, 0.02);
    padding: 6px 0;
    display: none;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition);
}

.avatar-dropdown.show {
    display: block;
    animation: fadeInDropdown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar-dropdown-user-info {
    padding: 10px 16px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 6px;
}

.avatar-dropdown-user-info .dropdown-name {
    font-weight: 600;
    font-size: 0.925rem;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-dropdown-user-info .dropdown-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.avatar-dropdown-item i {
    font-size: 1.05rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.avatar-dropdown-item:hover {
    background-color: var(--accent-glow);
    color: var(--accent-color);
}

.avatar-dropdown-item:hover i {
    color: var(--accent-color);
}

.avatar-dropdown-item.logout-link {
    color: var(--danger);
    border-top: 1px solid var(--glass-border);
    margin-top: 6px;
    padding-top: 12px;
}

.avatar-dropdown-item.logout-link i {
    color: var(--danger);
}

.avatar-dropdown-item.logout-link:hover {
    background-color: rgba(239, 68, 68, 0.05);
    color: var(--danger);
}


/* Dashboard Body Container */
.content-body {
    padding: 30px;
    flex-grow: 1;
    background: radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.04) 0%, transparent 40%), var(--bg-primary);
}

/* Grid layout for analytics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-info .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    border: 1px solid var(--glass-border);
}

/* Custom visual styling based on values */
.stat-card.success .stat-icon {
    color: var(--success);
    background-color: rgba(16, 185, 129, 0.05);
}
.stat-card.danger .stat-icon {
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.05);
}
.stat-card.warning .stat-icon {
    color: var(--warning);
    background-color: rgba(245, 158, 11, 0.05);
}

/* Dashboard Graphs & Lists Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        width: 70px;
    }
    .sidebar-brand span, .sidebar-link span {
        display: none;
    }
    .main-wrapper {
        margin-left: 70px;
    }
}

/* Common table styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.825rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--bg-tertiary);
    font-weight: 600;
}

.table td {
    padding: 12px 14px;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--glass-border);
}

.table tr:hover td {
    background-color: rgba(14, 165, 233, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Landing Page Grid */
.landing-hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.12) 0%, transparent 60%);
}

.landing-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.landing-hero h1 span {
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-hero p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 35px;
}

.landing-buttons {
    display: flex;
    gap: 15px;
}

/* Modals & Switch Sliders */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.25s ease-out;
}
.modal.show {
    display: block;
    opacity: 1;
}
.modal-dialog {
    position: relative;
    margin: 5% auto;
    width: 90%;
    max-width: 750px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(14, 165, 233, 0.08);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transform: translateY(-30px);
    transition: transform 0.25s ease-out;
}
.modal.show .modal-dialog {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--glass-border);
}
.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: var(--transition);
}
.btn-close:hover {
    color: var(--text-primary);
}
.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
}

/* Custom Switch Toggle */
.form-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}
.form-switch input {
    display: none;
}
.slider {
    background-color: var(--bg-tertiary);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .3s;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
}
.slider:before {
    background-color: var(--text-muted);
    bottom: 2px;
    content: "";
    height: 18px;
    left: 2px;
    position: absolute;
    transition: .3s;
    width: 18px;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: rgba(16, 185, 129, 0.2);
    border-color: var(--success);
}
input:checked + .slider:before {
    background-color: var(--success);
    transform: translateX(24px);
}

/* Access Matrix Table Styles */
.accessibility-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.accessibility-table th, .accessibility-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}
.accessibility-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
}
.accessibility-table tr:hover td {
    background: rgba(14, 165, 233, 0.03);
}

/* Sidebar Dropdown Accordion */
details.sidebar-dropdown {
    width: 100%;
}
details.sidebar-dropdown summary.sidebar-link-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.925rem;
    transition: var(--transition);
}
details.sidebar-dropdown summary.sidebar-link-summary::-webkit-details-marker {
    display: none;
}
details.sidebar-dropdown summary.sidebar-link-summary:hover {
    background-color: var(--accent-glow);
    color: var(--accent-color);
}
details.sidebar-dropdown[open] summary.sidebar-link-summary {
    color: var(--accent-color);
}
details.sidebar-dropdown[open] .dropdown-chevron {
    transform: rotate(180deg);
}
.sidebar-submenu {
    list-style: none;
    padding-left: 28px;
    margin-top: 4px;
    margin-bottom: 8px;
}
.sidebar-subitem {
    margin-bottom: 2px;
}
.sidebar-sublink {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.sidebar-sublink:hover, .sidebar-subitem.active .sidebar-sublink {
    color: var(--accent-color);
    background-color: var(--accent-glow);
}
.dropdown-chevron {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}
.main-wrapper {
    margin-left: 260px;
}
@media (max-width: 992px) {
    .main-wrapper {
        margin-left: 70px;
    }
}
