:root {
    --primary: #2196F3;
    --primary-dark: #1976D2;
    --primary-light: #BBDEFB;
    --text-primary: #212121;
    --text-secondary: #757575;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-tertiary: #EEEEEE;
    --border: #E0E0E0;
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #F44336;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

.dark-mode {
    --primary: #2196F3;
    --primary-dark: #1976D2;
    --primary-light: #0D47A1;
    --text-primary: #FFFFFF;
    --text-secondary: #B0BEC5;
    --bg-primary: #121212;
    --bg-secondary: #1E1E1E;
    --bg-tertiary: #2D2D2D;
    --border: #424242;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-secondary);
}

/* Header Styles */
header {
    background-color: var(--bg-secondary);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-image {
    width: 32px;
    height: 32px;
    background-color: var(--bg-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}
.logo-image img {
    width: 24px;
    height: 24px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.header-icon-btn:hover {
    background-color: var(--bg-tertiary);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--error);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    /* Ensure it's always visible when displayed */
    opacity: 1 !important;
    visibility: visible !important;
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 25px;
}

.theme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: var(--transition);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 19px;
    width: 19px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(25px);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

/* Auth Container */
.auth-container {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 1.75rem;
    transition: var(--transition);
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.6rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 0.9rem;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.form-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.form-select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.suggestions-container {
    position: relative;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: var(--shadow);
}

.suggestion-item {
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
}

.suggestion-item:hover {
    background-color: var(--bg-tertiary);
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background-color: var(--primary-dark);
}

.btn:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary-light);
}

.btn-text, .btn-loading {
    transition: opacity 0.3s ease;
}

.btn-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.form-footer {
    margin-top: 1.25rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Styles */
.dashboard-container {
    display: none;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-content {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--bg-secondary);
    padding: 1.25rem;
    border-right: 1px solid var(--border);
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.profile-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
}

.profile-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.profile-class {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.6rem;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.4rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.85rem;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--bg-tertiary);
    color: var(--primary);
}

.nav-icon {
    margin-right: 0.6rem;
    font-size: 1rem;
}

/* Main Dashboard Area */
.main-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.content-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.content-actions {
    display: flex;
    gap: 0.85rem;
}

.section-card {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.edit-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.info-value {
    font-weight: 500;
    font-size: 0.9rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background-color: rgba(76, 175, 80, 0.2);
    color: var(--success);
}

.status-inactive {
    background-color: rgba(244, 67, 54, 0.2);
    color: var(--error);
}

.status-verified {
    background-color: rgba(33, 150, 243, 0.2);
    color: var(--primary);
}

.status-pending {
    background-color: rgba(255, 152, 0, 0.2);
    color: var(--warning);
}

.course-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.course-card {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left: 3px solid var(--primary);
}

.course-name {
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.course-year {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Notification Panel */
.notification-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background-color: var(--bg-secondary);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.notification-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
}

.notification-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.notification-item {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.notification-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification-item.high-priority {
    border-left-color: var(--error);
}

.notification-item.medium-priority {
    border-left-color: var(--warning);
}

.notification-item-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.notification-item-message {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.notification-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.notification-attachments {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification-attachments .notification-image-container:not(:first-child) {
    margin-top: 0.5rem;
}

.attachment-item {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.75rem;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.attachment-link {
    color: var(--primary);
    text-decoration: none;
}

.attachment-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    text-decoration: none;
}

.notification-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.notification-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    display: block;
}

/* Better scrollbar for notification panel */
.notification-content::-webkit-scrollbar {
    width: 6px;
}

.notification-content::-webkit-scrollbar-track {
    background: transparent;
}

.notification-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.notification-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Live Chat Support */
.live-chat-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 98;
    transition: var(--transition);
}

.live-chat-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.chat-panel {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 350px;
    height: 500px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    z-index: 600;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.chat-panel.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary);
    color: white;
    border-radius: 12px 12px 0 0;
}

.chat-title {
    font-weight: 600;
    font-size: 1rem;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.message-student {
    align-self: flex-end;
    background-color: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-admin {
    align-self: flex-start;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-content {
    font-size: 0.85rem;
    line-height: 1.4;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    opacity: 0.8;
}

.message-status {
    display: flex;
    margin-left: 0.5rem;
}

.status-tick {
    font-size: 0.6rem;
    margin-left: -2px;
}

.status-sent {
    opacity: 0.5;
}

.status-delivered {
    opacity: 0.8;
}

.status-seen {
    opacity: 1;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 24px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.85rem;
    resize: none;
    max-height: 100px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

.chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.chat-send:hover {
    background-color: var(--primary-dark);
}

.chat-send:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
}

.chat-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.reply-indicator {
    display: none;
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
    justify-content: space-between;
    align-items: center;
}

.reply-cancel {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
}

.limit-warning {
    display: none;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 152, 0, 0.1);
    border-top: 1px solid rgba(255, 152, 0, 0.3);
    font-size: 0.75rem;
    color: var(--warning);
    text-align: center;
}

/* Backdrop for panels */
.panel-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 98;
}

/* Footer */
footer {
    background-color: var(--bg-secondary);
    padding: 1.25rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* Settings Styles */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.settings-section {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.settings-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.option-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radio-item input {
    width: 16px;
    height: 16px;
}

.radio-item label {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input {
    width: 16px;
    height: 16px;
}

.checkbox-item label {
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Theme Toggle Info */
.theme-toggle-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
}

.theme-toggle-text {
    flex: 1;
}

.theme-toggle-text h4 {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.theme-toggle-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .dashboard-content {
        flex-direction: column;
    }

    .sidebar {
        width: 280px;
        border-right: none;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
    }

    .content-actions {
        width: 100%;
        justify-content: space-between;
    }

    .info-grid, .form-row {
        grid-template-columns: 1fr;
    }

    .notification-panel {
        width: 100%;
        right: -100%;
    }

    .chat-panel {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    /* Fix for mobile chat header */
    .chat-header {
        padding-top: calc(1rem + env(safe-area-inset-top));
        padding-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.6rem 1rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .auth-container {
        padding: 1.25rem;
    }

    .main-content {
        padding: 1rem;
    }
}

.notification-badge.pulse {
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.image-caption {
    padding: 0.5rem;
    background-color: var(--bg-tertiary);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    border-top: 1px solid var(--border);
}

.image-error {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    border-radius: 6px;
    font-size: 0.8rem;
}

/* Fix Notification Panel Display */
.notification-panel.active {
    right: 0 !important;
}

.panel-backdrop#notification-backdrop[style*="display: block"] {
    display: block !important;
}

/* Prevent body scroll when panel is open */
body.notification-panel-open {
    overflow: hidden;
}

.panel-backdrop#notification-backdrop {
    display: none;
    z-index: 999;
}

/* Improved notification image styling */
.notification-image-container {
    margin-top: 0.75rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: var(--bg-tertiary);
    position: relative;
}

.notification-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
    background-color: var(--bg-primary);
    border-radius: 6px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.notification-image:hover {
    transform: none;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.notification-image[src] {
    background: none;
    animation: none;
}

/* Enhanced Reply Context Styles */
.reply-context {
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary);
    cursor: default;
    transition: var(--transition);
}

.dark-mode .reply-context {
    background-color: rgba(255, 255, 255, 0.1);
}

.message-student .reply-context {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: rgba(255, 255, 255, 0.6);
}

.reply-sender {
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    opacity: 0.8;
    color: var(--primary);
}

.reply-text {
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Reply Indicator Styles */
.reply-indicator {
    display: none;
    padding: 0.75rem 1rem;
    background-color: var(--primary-light);
    border-bottom: 1px solid var(--primary);
    font-size: 0.8rem;
    color: var(--text-primary);
    justify-content: space-between;
    align-items: center;
}

.reply-cancel {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.reply-cancel:hover {
    background-color: var(--primary);
    color: white;
}

/* Message bubble hover effect for replies */
.message-bubble.message-admin {
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.message-bubble.message-admin:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-bubble.message-admin:hover::after {
    content: 'Click to reply';
    position: absolute;
    top: -20px;
    right: 10px;
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.message-bubble.replying {
    background-color: var(--primary-light) !important;
    border: 2px solid var(--primary) !important;
    transform: scale(1.02);
}

/* Admin name styling */
.admin-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    margin-left: 0.5rem;
}

/* Enhanced status indicators */
.message-status {
    display: flex;
    margin-left: 0.5rem;
}

.status-tick {
    font-size: 0.6rem;
    margin-left: -2px;
}

.status-sent {
    opacity: 0.5;
}

.status-delivered {
    opacity: 0.8;
}

.status-seen {
    opacity: 1;
    color: var(--primary);
}

/* Real-time typing indicator */
.typing-indicator {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.typing-dots {
    display: inline-block;
}

.typing-dots span {
    animation: typing 1.4s infinite;
    opacity: 0.6;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.6; }
    30% { opacity: 1; }
}

/* Error Message Styles */
.error-message {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.error-message i {
    font-size: 0.7rem;
}

.form-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
}

.success-message {
    color: var(--success);
    font-size: 0.8rem;
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.success-message i {
    font-size: 0.7rem;
}

/* Password Reset Modal */
.password-reset-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.password-reset-content {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    padding: 2rem;
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow);
    position: relative;
}

.password-reset-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
}

.password-reset-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.password-reset-steps {
    display: none;
}

.password-reset-steps.active {
    display: block;
}

.password-reset-info {
    background-color: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.password-reset-info i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.verification-code-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.verification-code-input {
    flex: 1;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.2rem;
}

.resend-code {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.resend-code a {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

.resend-code a:hover {
    text-decoration: underline;
}

.resend-code.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.countdown-timer {
    color: var(--primary);
    font-weight: 600;
}

/* Account Password Reset */
.account-password-reset {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.password-strength {
    margin-top: 0.4rem;
    height: 4px;
    border-radius: 2px;
    background-color: var(--bg-tertiary);
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.password-strength.weak .password-strength-fill {
    background-color: var(--error);
    width: 33%;
}

.password-strength.medium .password-strength-fill {
    background-color: var(--warning);
    width: 66%;
}

.password-strength.strong .password-strength-fill {
    background-color: var(--success);
    width: 100%;
}

.password-requirements {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.password-requirements ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.25rem;
}

.password-requirements li {
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.password-requirements li.requirement-met {
    color: var(--success);
}

.password-requirements li.requirement-not-met {
    color: var(--text-secondary);
}

.password-requirements li i {
    font-size: 0.7rem;
}

/* Enhanced Password Reset Styles */
.password-reset-info {
    background-color: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.password-reset-info i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.password-reset-info strong {
    color: var(--primary-dark);
}

/* Success state for reset steps */
.password-reset-steps[style*="display: block"] {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Resend link styling */
.resend-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.resend-link:hover {
    text-decoration: underline;
}

/* Email sent confirmation styling */
.email-sent-confirmation {
    text-align: center;
    padding: 1.5rem;
}

.email-sent-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.email-sent-title {
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.email-sent-message {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.email-tips {
    background: var(--primary-light);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: left;
    font-size: 0.85rem;
}

/* Icon spacing in labels and buttons */
.form-label i,
.btn i,
.nav-icon i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
}

/* Auth tab icons */
.auth-tab i {
    margin-right: 0.5rem;
}

/* Content title icons */
.content-title i {
    margin-right: 0.75rem;
}

/* Section title icons */
.section-title i {
    margin-right: 0.5rem;
}

/* Edit button icons */
.edit-btn i {
    margin-right: 0.25rem;
}

/* Better alignment for form elements with icons */
.form-group {
    position: relative;
}

/* Ensure proper spacing in buttons with icons */
.btn .btn-text,
.btn .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading states for settings */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.settings-section {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}