/* Dashboard Layout */
:root {
    --sidebar-width: 260px;
    --header-height: 60px;
    --primary-color: #0d6efd;
    --sidebar-bg: #fff;
    --sidebar-text: #333;
    --sidebar-active-bg: #e9f2ff;
    --sidebar-active-text: #0d6efd;
    --bg-light: #f5f7fa;
}

body {
    background-color: var(--bg-light);
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid #e0e0e0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.brand-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo i {
    font-size: 1.6rem;
}

.sidebar-menu {
    padding: 1.5rem 0;
    flex: 1;
    overflow-y: auto;
}

.menu-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #a0aec0;
    padding: 0 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 0.05rem;
}

.nav-item {
    list-style: none;
}

.nav-link {
    display: flex !important;
    align-items: center;
    padding: 0.85rem 1.5rem;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 1.05rem;
    border-right: 4px solid transparent;
}

.nav-link:hover {
    background-color: #f7fafc;
    color: var(--primary-color);
}

.nav-link.active {
    background-color: #ebf4ff;
    color: var(--primary-color);
    border-right-color: var(--primary-color);
    font-weight: 600;
}

.nav-link.active i {
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #f0f0f0;
}

/* Main Content */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

.top-header {
    height: var(--header-height);
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.content-area {
    padding: 2rem;
    flex: 1;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    background-color: #fff;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Notifications Dropdown */
.notification-dropdown {
    width: 320px;
    padding: 0;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.notification-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h6 {
    margin: 0;
    font-weight: 700;
}

.notification-item {
    padding: 1.25rem;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 0.5rem;
}

.notification-time {
    font-size: 0.75rem;
    color: #a0aec0;
}

.notification-footer {
    padding: 0.75rem;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.notification-footer a {
    font-size: 0.85rem;
    color: #718096;
    text-decoration: none;
    font-weight: 500;
}

/* Notification Dropdown Styles */
.notification-dropdown {
    overflow: hidden;
    border-radius: 12px !important;
}

.notification-list .dropdown-item:hover {
    background-color: #f8f9fa;
}

.bg-primary-soft { background-color: rgba(13, 110, 253, 0.1); }
.bg-success-soft { background-color: rgba(25, 135, 84, 0.1); }
.bg-info-soft { background-color: rgba(13, 202, 240, 0.1); }
.bg-danger-soft { background-color: rgba(220, 53, 69, 0.1); }

.text-primary-soft { color: #0d6efd; }

/* Sidebar Lottie Icons */
.lottie-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 12px;
    transition: transform 0.2s ease, opacity 0.3s ease;
    overflow: visible;
    opacity: 0; /* Initially hidden to prevent flicker */
}

.lottie-icon-wrapper.loaded {
    opacity: 1; /* Fade in when loaded */
}

.lottie-sidebar-icon {
    width: 38px;
    height: 38px;
}

/* Active state icon scaling */
.nav-link.active .lottie-icon-wrapper,
.nav-link.active i {
    transform: scale(1.15);
}

.nav-link i {
    width: 40px;
    margin-right: 12px;
    font-size: 1.8rem;
    color: #718096;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

/* Special sizing for System Settings as requested */
.nav-link-settings {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
}

/* Unified sizing for all main sidebar icons to be equally large */
#lottie-settings-admin,
#lottie-certificate-teacher,
#lottie-certificate-student {
    width: 40px !important;
    height: 40px !important;
    transform-origin: center;
}

#lottie-bell {
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bell-container {
    position: relative;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.bell-container:hover {
    background-color: #f0f4f8;
}

.unread-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background-color: #e53e3e;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid white;
}


.greeting-card {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    position: relative;
    overflow: hidden;
    color: white;
}

.greeting-card-teacher {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    position: relative;
    overflow: hidden;
    color: white;
}

.greeting-card-admin {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    position: relative;
    overflow: hidden;
    color: white;
}

.greeting-card .greeting-decoration,
.greeting-card-teacher .greeting-decoration {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

/* Toast Notifications (Floating Messages) */
.toast-container {
    position: fixed;
    top: 85px;
    right: 30px;
    z-index: 9999;
}

.custom-toast {
    background: white;
    min-width: 380px;
    max-width: 450px;
    border-radius: 16px;
    padding: 20px 28px;
    margin-bottom: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 6px solid #0d6efd;
    animation: slideIn 0.3s ease-out forwards;
}

.custom-toast.success { border-left-color: #198754; }
.custom-toast.info { border-left-color: #0dcaf0; }
.custom-toast.warning { border-left-color: #ffc107; }
.custom-toast.error { border-left-color: #dc3545; }

.toast-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.toast-content {
    flex-grow: 1;
    font-size: 1.05rem;
    font-weight: 500;
    color: #2d3748;
}

.toast-close {
    cursor: pointer;
    color: #a0aec0;
    font-size: 1.2rem;
    transition: color 0.2s;
    padding: 4px;
}

.toast-close:hover { color: #333; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.custom-toast.hide {
    animation: slideOut 0.3s ease-in forwards;
}

/* Login Page & Public Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-light);
}

.public-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--bg-light);
    padding: 2rem;
}
