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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh';
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Clickable Student Names */
.clickable-name {
    color: #007bff;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.clickable-name:hover {
    color: #0056b3;
    text-decoration: none;
}

/* Hijri Settings */
.hijri-settings {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.hijri-settings .help-text {
    color: #666;
    font-size: 14px;
    margin: 5px 0 10px 0;
    font-style: italic;
}

.hijri-preview {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.hijri-date-display {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    margin-top: 8px;
}

/* Form Grid Layout for Settings */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Flexbox utilities for settings */
.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Hijri Date Dashboard Display */
.hijri-date-dashboard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.hijri-date-dashboard .date-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.hijri-date-dashboard .date-display i {
    font-size: 20px;
    color: #ffd700;
    margin-right: 15px;
}

.hijri-date-dashboard .date-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hijri-date-dashboard .hijri-main {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.hijri-date-dashboard .gregorian-sub {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

/* Hijri Date in Attendance Page */
.hijri-date-attendance {
    background: #e8f4fd;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 12px 15px;
    margin-top: 15px;
}

.hijri-date-attendance .hijri-date-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2c5aa0;
    font-weight: 500;
    font-size: 16px;
}

.hijri-date-attendance .hijri-date-info i {
    color: #4a90e2;
}

/* Report Hijri Header */
.report-hijri-header {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    text-align: center;
}

.report-hijri-header .hijri-date-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #495057;
    font-weight: 500;
    font-size: 16px;
}

.report-hijri-header .hijri-date-range i {
    color: #6c757d;
}

/* Holiday Management Styles */
.holiday-management {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.add-holiday {
    margin-bottom: 2rem;
}

.holiday-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.holiday-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.holiday-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.student-management {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #e8f5e8;
    border-radius: 8px;
}

.help-text {
    margin-top: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.date-restriction-notice {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 15px;
    color: #1976d2;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-restriction-notice i {
    color: #2196f3;
}

.date-restriction-notice span {
    font-weight: 500;
}

/* Holiday Notice */
.holiday-notice {
    text-align: center;
    padding: 2rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
}

.holiday-notice i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #f39c12;
}

.holiday-notice h3 {
    margin-bottom: 1rem;
    color: #856404;
}

.holiday-notice p {
    margin: 0;
    font-size: 1.1rem;
}

/* Dashboard Holiday Notice */
.dashboard-holiday-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.dashboard-holiday-notice i {
    font-size: 1.2rem;
    color: #f39c12;
}

/* Calendar Holiday Styling */
.calendar-day.holiday {
    background-color: #fff3cd !important;
    border-color: #ffeaa7 !important;
    color: #856404 !important;
    min-height: 32px;
    max-height: 32px;
    width: 32px;
    height: 32px;
}

.calendar-day.holiday::after {
    content: "🎉";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.7rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-text {
    text-align: center;
    flex: 1;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.header h1:hover {
    color: #f8f9fa;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transform: scale(1.02);
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.language-selector label {
    color: white;
    font-size: 1.2em;
    cursor: pointer;
}

.language-selector select {
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    padding: 5px;
}

.language-selector select option {
    background: #2c3e50;
    color: white;
    padding: 5px;
}

/* Navigation */
.nav {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    position: relative;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #2c3e50;
    cursor: pointer;
    padding: 15px 20px;
    position: absolute;
    right: 20px;
    top: 0;
    z-index: 1001;
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    min-height: 48px;
}

.nav-link:hover,
.nav-link.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background-color: #f8f9fa;
}

.nav-link i {
    margin-right: 8px;
    flex-shrink: 0;
}

/* Navigation dropdown toggle should look like regular nav links */
.nav-link.dropdown-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 15px 25px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #666;
    font-size: inherit;
    font-weight: normal;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link.dropdown-toggle:hover,
.nav-link.dropdown-toggle.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background-color: #f8f9fa;
}

.nav-link.dropdown-toggle i.fa-chevron-down {
    margin-left: 5px;
    font-size: 12px;
}

/* Main Content */
.main {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

.section {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 2em;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    min-width: 250px;
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 3em;
    color: #3498db;
    margin-bottom: 15px;
}

.stat-card h3 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 5px;
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.stat-card p {
    color: #666;
    font-size: 1em;
    line-height: 1.4;
    word-wrap: break-word;
    hyphens: auto;
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Combined Attendance Card Styles */
.attendance-combined-card {
    text-align: center !important;
    padding: 15px !important;
    justify-content: center !important;
}

/* Attendance card now uses same structure as performance card */
.attendance-combined-card .performance-tiers {
    display: flex;
    justify-content: space-around;
    width: 100%;
    gap: 8px;
}

.attendance-combined-card .tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
}

.attendance-combined-card .tier-count {
    font-size: 1.5em;
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.attendance-combined-card .tier-label {
    font-size: 0.9em;
    color: #495057;
    font-weight: 500;
    opacity: 0.8;
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Alert Card Styles */
.alerts-header {
    text-align: center;
    margin-bottom: 10px;
}

.alerts-preview {
    flex: 1;
    max-height: 100px;
    overflow-y: auto;
}

.alerts-preview .alert-item-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 11px;
}

.alerts-preview .alert-item-compact:last-child {
    border-bottom: none;
}

.alerts-preview .alert-icon-compact {
    font-size: 10px;
    width: 12px;
    text-align: center;
}

.alerts-preview .alert-text-compact {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Performance Tiers - Horizontal Layout */
.performance-tiers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tier-count {
    font-weight: bold;
    font-size: 1.2em;
    color: #2c3e50;
    margin-bottom: 2px;
}

.tier-label {
    font-size: 0.7em;
    color: #666;
}

/* Main Dashboard Alerts */
.dashboard-alerts-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
    padding: 20px;
    border-left: 4px solid #f39c12;
}

.dashboard-alerts-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3em;
}

.dashboard-alerts-section h3 i {
    color: #f39c12;
}

.alerts-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.alert-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.alert-item.danger {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
}

.alert-item.warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-item.info {
    background: #eff6ff;
    border-left-color: #3b82f6;
    color: #1e40af;
}

.alert-btn.info {
    background: #3b82f6;
    color: white;
}

.alert-btn.info:hover {
    background: #2563eb;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.alert-icon {
    font-size: 1.2em;
    width: 24px;
    text-align: center;
}

.alert-text {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 2px;
}

.alert-message {
    font-size: 0.85em;
    opacity: 0.9;
}

.alert-actions {
    display: flex;
    gap: 8px;
}

.alert-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.alert-btn.primary {
    background: #3b82f6;
    color: white;
}

.alert-btn.primary:hover {
    background: #2563eb;
}

.alert-btn.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.alert-btn.secondary:hover {
    background: #e5e7eb;
}

.alert-btn.danger {
    background: #ef4444;
    color: white;
}

.alert-btn.danger:hover {
    background: #dc2626;
}

/* Alert Details Styles */
.alert-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    animation: slideDown 0.3s ease-out;
}

.alert-details-content {
    background: #f9fafb;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #e5e7eb;
}

.alert-students-table {
    overflow-x: auto;
}

.alert-students-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.alert-students-table th {
    background: #f3f4f6;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #d1d5db;
}

.alert-students-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.alert-students-table tr:hover {
    background: #f9fafb;
}

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

/* Mobile responsive styles for alerts - MOVED TO mobile.css */

/* Performance Card Styles */
.performance-card {
    height: 180px !important;
    position: relative;
}

.performance-card .performance-tiers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    width: 100%;
    padding: 0 10px;
}

.performance-card .tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.performance-card .tier-count {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 2px;
}

.performance-card .tier-label {
    font-size: 0.7em;
    color: #666;
    line-height: 1.2;
}

.performance-card .tier.mustaid .tier-count {
    color: #27ae60; /* Green for Mustaid (Excellent) */
}

.performance-card .tier.mutawassit .tier-count {
    color: #f39c12; /* Orange for Mutawassit (Average) */
}

.performance-card .tier.mujtahid .tier-count {
    color: #e74c3c; /* Red for Mujtahid (Needs Improvement) */
}

/* Class Dashboard Card Colors */
#class-total-students {
    color: #2c3e50 !important; /* Dark blue for total students */
}

#class-present-today {
    color: #27ae60 !important; /* Green for present students */
}

#class-absent-today {
    color: #e74c3c !important; /* Red for absent students */
}

#class-attendance-rate {
    color: #e74c3c !important; /* Default red, will be overridden by JavaScript */
}

#class-inactive-students {
    color: #f39c12 !important; /* Orange for inactive students */
}

/* Attendance Rate Color Classes */
.attendance-high {
    color: #27ae60 !important; /* Green for ≥80% */
}

.attendance-medium {
    color: #f39c12 !important; /* Orange for ≥60% */
}

.attendance-low {
    color: #e74c3c !important; /* Red for <60% */
}

/* Recent Activity */
.recent-activity {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.recent-activity h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.overview-content {
    max-height: 300px;
    overflow-y: auto;
}

/* Class-wise Stats */
.class-wise-stats {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.class-wise-stats h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.class-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.class-stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: transform 0.3s ease;
}

.class-stat-card:hover {
    transform: translateY(-2px);
}

.class-stat-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.class-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 5px 0;
}

.class-stats span {
    font-size: 14px;
    color: #666;
}

.class-stats .stat-number {
    font-weight: 600;
    color: #2c3e50;
}

.class-attendance-rate {
    font-size: 1.1em;
    font-weight: 600;
    color: #27ae60;
    text-align: center;
    margin-top: 10px;
}

/* New Class Stats Table Styles */
.class-stats-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.class-stats-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.class-stats-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.class-stats-table th {
    padding: 15px 12px;
    text-align: center;
    font-weight: 600;
    border: none;
    white-space: nowrap;
}

.class-stats-table th:first-child {
    text-align: left;
    border-radius: 8px 0 0 0;
}

.class-stats-table th:last-child {
    border-radius: 0 8px 0 0;
}

.class-stats-table tbody tr {
    border-bottom: 1px solid #e1e8ed;
    transition: background-color 0.2s ease;
}

.class-stats-table tbody tr:hover {
    background-color: #f8f9fa;
}

.class-stats-table tbody tr:last-child {
    border-bottom: none;
}

.class-stats-table td {
    padding: 12px;
    text-align: center;
    border: none;
}

.class-stats-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
}

.class-stats-table .attendance-high {
    color: #27ae60;
    font-weight: 600;
}

.class-stats-table .attendance-medium {
    color: #f39c12;
    font-weight: 600;
}

.class-stats-table .attendance-low {
    color: #e74c3c;
    font-weight: 600;
}

.class-stats-table .score-excellent {
    color: #27ae60 !important;
    font-weight: 600;
    background-color: rgba(39, 174, 96, 0.1);
}

.class-stats-table .score-average {
    color: #f39c12 !important;
    font-weight: 600;
    background-color: rgba(243, 156, 18, 0.1);
}

.class-stats-table .score-poor {
    color: #e74c3c !important;
    font-weight: 600;
    background-color: rgba(231, 76, 60, 0.1);
}

/* Loading Indicator Styles */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    gap: 15px;
}

.loading-indicator i {
    font-size: 24px;
    color: #3498db;
}

.loading-indicator span {
    font-weight: 500;
}

/* Student Detail Styles */
.student-detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.student-detail-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.student-info-card {
    padding: 30px;
}

.student-basic-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.info-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.info-group h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

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

.info-label {
    font-weight: 600;
    color: #666;
}

.info-value {
    color: #2c3e50;
}

/* Status indicators */
.status-active {
    color: #28a745;
    font-weight: bold;
}

.status-inactive {
    color: #dc3545;
    font-weight: bold;
}

.attendance-history {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
}

.attendance-history h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.attendance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.summary-item h5 {
    color: #666;
    margin-bottom: 5px;
    font-size: 14px;
}

.summary-item .number {
    font-size: 1.5em;
    font-weight: 600;
    color: #2c3e50;
}

.summary-item.present .number {
    color: #27ae60;
}

.summary-item.absent .number {
    color: #e74c3c;
}

.summary-item.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.summary-item.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #e74c3c;
}

.click-hint {
    font-size: 0.7rem;
    color: #666;
    margin-top: 4px;
    opacity: 0.8;
}

/* Absent Days Modal Styles */
.absent-days-modal {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.absent-days-modal .modal-header h3 {
    color: #e74c3c;
    margin: 0;
}

.period-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #e74c3c;
}

.period-info p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.no-absent-days {
    text-align: center;
    color: #27ae60;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.absent-days-list {
    max-height: 400px;
    overflow-y: auto;
}

.absent-day-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.absent-day-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-color: #e74c3c;
}

.absent-date {
    font-weight: 600;
    color: #e74c3c;
    font-size: 1rem;
    margin-bottom: 4px;
}

.absent-reason {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.attendance-calendar {
    margin-top: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}



.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    max-height: 300px;
    overflow-y: auto;
    align-items: center;
    justify-items: center;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 32px;
    max-height: 32px;
    width: 32px;
    height: 32px;
}



.clickable-name {
    color: #3498db;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.clickable-name:hover {
    color: #2980b9;
}

/* Forms */
.form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn i {
    flex-shrink: 0;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-small {
    padding: 8px 15px;
    font-size: 14px;
}

/* Attendance Controls */
.attendance-controls {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap;
    gap: 20px;
}

.controls-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: nowrap;
    width: 100%;
}

/* Bulk Actions */
.bulk-actions {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.bulk-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-bulk {
    padding: 15px 20px;
    font-size: 14px;
    white-space: nowrap;
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
}

.btn-bulk i {
    font-size: 16px;
    flex-shrink: 0;
}

.bulk-info {
    color: #666;
    font-size: 14px;
}

.bulk-info span {
    font-weight: 600;
    color: #2c3e50;
}

/* Bulk Absent Modal */
.bulk-absent-form {
    padding: 20px 0;
}

.bulk-absent-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.bulk-absent-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
}

.bulk-absent-form input:focus {
    outline: none;
    border-color: #e74c3c;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Custom Button Styles for Bulk Actions */
.btn-holiday {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    color: #2c3e50;
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(241, 196, 15, 0.2);
    transition: all 0.3s ease;
}

.btn-holiday:hover {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(241, 196, 15, 0.4);
}

.btn-clear {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(149, 165, 166, 0.2);
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7b7d 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(149, 165, 166, 0.3);
}

.btn-copy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-copy::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-copy:hover::before {
    left: 100%;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #0056b3;
}

/* Small button size */
.btn-sm {
    padding: 8px 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.25rem;
}

.btn-sm i {
    font-size: 0.8rem;
    margin-right: 4px;
}

.date-selector,
.class-filter {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    max-width: 300px;
    flex: 1;
}

.date-selector label,
.class-filter label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.date-selector input,
.class-filter select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.student-count {
    color: #666;
    font-size: 12px;
}

/* Inline reason input styling */
.inline-reason-input {
    margin-left: 10px;
    display: inline-block;
}

.reason-input-inline {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    width: 200px;
    background: #fff;
    color: #333;
}

.reason-input-inline:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.reason-display {
    margin-left: 8px;
    color: #dc3545;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Data Management Reset List */
.reset-list {
    margin-bottom: 30px;
}

.reset-category {
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.reset-category h4 {
    background: #f8f9fa;
    color: #495057;
    margin: 0;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reset-items {
    background: white;
}

.reset-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

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

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

.reset-label {
    font-weight: 600;
    color: #495057;
    min-width: 180px;
    margin-right: 16px;
}

.reset-description {
    color: #6c757d;
    font-size: 0.9rem;
    flex: 1;
    margin-right: 16px;
}

.reset-item .btn {
    min-width: 80px;
    font-size: 0.8rem;
    padding: 6px 12px;
}

.danger-zone {
    background: #fff5f5;
    border: 2px solid #fed7d7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.danger-zone h4 {
    color: #e53e3e;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.danger-zone .help-text {
    color: #c53030;
    font-weight: 500;
    margin-bottom: 15px;
}

/* Attendance List */
.attendance-list {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar styling for attendance list */
.attendance-list::-webkit-scrollbar {
    width: 8px;
}

.attendance-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.attendance-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
}

.attendance-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.student-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.student-row:last-child {
    border-bottom: none;
}

.student-info h4 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.student-info p {
    color: #666;
    font-size: 14px;
}

/* Father name now integrated using Islamic naming convention "bin" */

/* Student info with toggle layout */
.student-info-with-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.student-info-with-toggle .student-info {
    flex: 1;
    min-width: 0; /* Allow text to truncate if needed */
}

.student-info-with-toggle .attendance-toggle {
    flex-shrink: 0;
}

.attendance-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Status Badge Dropdown Design */
.attendance-dropdown {
    position: relative;
    min-width: 100px;
}

/* Attendance dropdown toggle styling */
.attendance-dropdown .dropdown-toggle {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s;
    min-width: 80px;
}

.attendance-dropdown .dropdown-toggle:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.attendance-dropdown .dropdown-toggle.present {
    background: #27ae60;
    color: white;
    border-color: #27ae60;
}

.attendance-dropdown .dropdown-toggle.absent {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.attendance-dropdown .dropdown-toggle.clear {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.attendance-dropdown .dropdown-toggle.neutral {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.attendance-dropdown .dropdown-toggle.holiday {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    margin-top: 5px;
    min-width: 120px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    font-size: 12px;
}

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

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.present {
    background: #27ae60;
}

.status-dot.absent {
    background: #e74c3c;
}

.status-dot.clear {
    background: #6c757d;
}

.status-dot.neutral {
    background: #6c757d;
}

.status-dot.holiday {
    background: #ffc107;
}

/* Removed unmarked-label as we now default to present */

.absence-reason {
    grid-column: 1 / -1;
    margin-top: 10px;
}

.absence-reason input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e74c3c;
    border-radius: 5px;
    font-size: 14px;
}

/* Attendance Save Section */
.attendance-save-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    text-align: center;
}

.btn-save-attendance {
    font-size: 16px;
    padding: 12px 30px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
}

.btn-save-attendance:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.save-note {
    margin-top: 10px;
    color: #6c757d;
    font-size: 14px;
    font-style: italic;
}

/* Student Detail Summary Period Toggle */
.attendance-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.summary-period-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-period-toggle label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.period-btn {
    padding: 8px 16px;
    border: 2px solid #dee2e6;
    background: #f8f9fa;
    color: #495057;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.period-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.period-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.period-btn.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* Attendance Summary Header - MOVED TO mobile.css */

/* Report Controls */
.report-controls {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.report-results {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-height: 300px;
    max-height: 600px; /* Set maximum height for scrollable container */
    overflow-y: auto; /* Enable vertical scrolling */
    overflow-x: auto; /* Enable horizontal scrolling if needed */
    /* Smooth scrolling */
    scroll-behavior: smooth;
}

/* Custom scrollbar styling for report results */
.report-results::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.report-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.report-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
}

.report-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.report-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.report-table th,
.report-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.report-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: relative;
}

.sortable-header {
    position: relative;
    user-select: none;
}

.sortable-header .column-filter {
    user-select: text;
    cursor: text;
    pointer-events: auto;
}

.sortable-header {
    cursor: pointer;
}

.sortable-header .column-filter {
    cursor: text !important;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.sort-btn:hover {
    background: #e9ecef;
    color: #3498db;
}

.sort-btn i {
    font-size: 12px;
}

.column-filter {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    width: 120px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 999;
    pointer-events: auto;
    background: white;
    color: #333;
    outline: none;
}

.column-filter:focus {
    outline: none;
    border-color: #3498db;
    width: 120px;
    z-index: 1000;
    position: relative;
}

.column-filter::placeholder {
    color: #999;
    font-size: 11px;
}

.status-present {
    color: #27ae60;
    font-weight: 600;
}

.status-absent {
    color: #e74c3c;
    font-weight: 600;
}

.sortable-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Settings */
.settings-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Settings Tab System Styles */
.settings-tabs {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0 25px;
    margin-bottom: 20px;
    border-radius: 10px 10px 0 0;
}

.tab-button {
    padding: 15px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1em;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #3498db;
}

.tab-button.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-content {
    display: none;
    padding: 25px;
    animation: fadeIn 0.5s;
}

.tab-content.active {
    display: block;
}

/* Settings Group Styles */
.setting-group {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.setting-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.setting-group h3 {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.setting-group .help-text {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: -5px;
    margin-bottom: 10px;
}

.setting-group .input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.setting-group .input-group input,
.setting-group .input-group select {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1em;
}

/* Item List Styles */
.item-list {
    margin-top: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    padding: 10px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: 4px;
}

.list-item:nth-child(odd) {
    background-color: #f8f9fa;
}

.list-item-info strong {
    display: block;
    color: #2c3e50;
}

.list-item-info span {
    font-size: 0.85em;
    color: #6c757d;
}

/* Danger Zone Styles */
.danger-zone {
    border: 2px solid #e74c3c;
    border-radius: 8px;
    padding: 20px;
    background-color: #f8d7da;
}

.danger-zone h4 { 
    color: #721c24; 
    margin-top: 0; 
    font-size: 1.2em; 
}

.danger-zone p { 
    color: #721c24; 
    margin-bottom: 15px; 
}

.danger-zone .btn { 
    margin-right: 10px; 
}

/* Responsive Design for Settings Tabs - MOVED TO mobile.css */

.settings-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.add-class {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.add-class input {
    flex: 1;
    min-width: 250px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.classes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.class-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.class-name {
    font-weight: 600;
    color: #2c3e50;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease-in;
    backdrop-filter: blur(2px);
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 96vh;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

/* Responsive Design - Header & Navigation - MOVED TO mobile.css */

/* General Mobile Styles 480px - MOVED TO mobile.css */

/* ===== NEW UI IMPROVEMENTS ===== */

/* Student Management Styles */
.students-management {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.students-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 1px solid #eee;
}

.students-list-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.students-list-header h3 i {
    margin-right: 10px;
    color: #ffd700;
}

.students-list-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.students-table-container {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #eee;
}

.students-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.students-table thead {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}

.students-table .filter-row {
    background: #ffffff !important;
    border-bottom: 2px solid #dee2e6;
}

.students-table .filter-row th {
    padding: 8px 12px;
    vertical-align: middle;
}

.students-table .column-filter {
    width: 100%;
    max-width: 150px;
    margin: 0;
    font-size: 12px;
    border: 1px solid #ddd;
}

.students-table .filter-row .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #666;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.students-table .filter-row .btn-sm:hover {
    background: #e9ecef;
    color: #333;
    border-color: #adb5bd;
}

.students-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.students-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.students-table tbody tr:hover {
    background-color: #f8f9fa;
}

.students-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

.students-table .clickable-name {
    cursor: pointer;
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.students-table .clickable-name:hover {
    color: #2980b9;
    text-decoration: underline;
}

.class-badge {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    min-width: auto;
}

.no-students-message {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-students-message i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 15px;
}

.no-students-message p {
    font-size: 16px;
    margin: 0;
}

/* Student Registration Form Improvements */
.student-form-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 25px;
    margin-top: 20px;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.form-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 22px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Keep original attendance toggle design - just default to present */

/* Class Management Improvements */
.class-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.class-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.class-name {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
    flex: 1;
}

.class-actions {
    display: flex;
    gap: 8px;
}

.class-edit-input {
    padding: 6px 10px;
    border: 2px solid #3498db;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    background: #f8f9fa;
}

.class-edit-input:focus {
    outline: none;
    border-color: #2980b9;
    background: white;
}

/* Settings Page Accordion/Tabs */
.settings-content {
    display: grid;
    gap: 25px;
}

.settings-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.settings-section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.settings-section-header:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.settings-section-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section-content {
    padding: 20px;
    border-top: 1px solid #eee;
}

.settings-section.collapsed .settings-section-content {
    display: none;
}

.section-toggle-icon {
    transition: transform 0.3s ease;
}

.settings-section.collapsed .section-toggle-icon {
    transform: rotate(180deg);
}

/* Mobile Responsiveness for New Features - MOVED TO mobile.css */

/* Utility Classes */
.text-center { text-align: center; }
.text-success { color: #27ae60; }
.text-danger { color: #e74c3c; }
.text-warning { color: #f39c12; }
.text-muted { color: #6c757d; }

.bg-success { background-color: #d4edda; }
.bg-danger { background-color: #f8d7da; }
.bg-warning { background-color: #fff3cd; }
.bg-info { background-color: #d1ecf1; }

.border-success { border-color: #27ae60; }
.border-danger { border-color: #e74c3c; }
.border-warning { border-color: #f39c12; }
.border-info { border-color: #17a2b8; }

/* Attendance Tracking Calendar - Compact Version */
.attendance-tracking-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    max-width: 600px; /* Limit maximum width */
    margin-left: auto;
    margin-right: auto;
}

.attendance-tracking-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    text-align: center;
}

.calendar-container {
    margin-bottom: 20px;
    max-width: 420px; /* Compact calendar width */
    margin-left: auto;
    margin-right: auto;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px;
    width: 100%;
    max-width: 420px;
    align-items: center;
    justify-items: center;
}

.calendar-header {
    background: #3498db;
    color: white;
    padding: 8px 4px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    border-radius: 4px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Calendar day status classes */
.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.attendance-taken {
    background: #27ae60;
    color: white;
}

.calendar-day.attendance-auto-copied {
    background: #FFA726;
    color: white;
}

.calendar-day.attendance-pending {
    background: #f39c12;
    color: white;
}

.calendar-day.attendance-missed {
    background: #e74c3c;
    color: white;
}

.calendar-day.present {
    background: #27ae60;
    color: white;
}

.calendar-day.absent {
    background: #e74c3c;
    color: white;
}

.calendar-day.leave {
    background: #f39c12;
    color: white;
}

.calendar-day.no-data {
    background: #ddd;
    color: #666;
}

.calendar-day.holiday-day {
    background: #f39c12;
    color: white;
}

.calendar-day.future-day {
    background: #ecf0f1;
    color: #7f8c8d;
}

.calendar-day.disabled {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.calendar-day.disabled:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day.header {
    background: #2c3e50;
    color: white;
    font-weight: 600;
    min-height: 32px;
    max-height: 32px;
    width: 32px;
    height: 32px;
}

.day-number {
    font-weight: bold;
    font-size: 12px;
}

.calendar-day:hover:not(.empty) {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.legend-color.attendance-taken {
    background: #27ae60;
}

.legend-color.attendance-auto-copied {
    background: #FFA726;
}

.legend-color.attendance-pending {
    background: #f39c12;
}

.legend-color.attendance-missed {
    background: #e74c3c;
}

.legend-color.holiday-day {
    background: #f39c12;
}

/*
.legend-color.weekend-day {
    background: #95a5a6;
}
*/

.legend-color.future-day {
    background: #ecf0f1;
}

.legend-color.before-academic-year {
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    opacity: 0.6;
}

.legend-color.present {
    background: #27ae60;
}

.legend-color.absent {
    background: #e74c3c;
}

.legend-color.leave {
    background: #f39c12;
}

.legend-color.no-data {
    background: #ddd;
}

.summary-stats {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #3498db;
    max-width: 500px;
    margin: 0 auto;
}

.summary-stats h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
}

.summary-stats .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.stat-card.success {
    border-left: 4px solid #27ae60;
}

.stat-card.danger {
    border-left: 4px solid #e74c3c;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    color: #7f8c8d;
    font-weight: 500;
}

.additional-stats {
    color: #555;
    font-size: 0.85rem;
    text-align: center;
}

.additional-stats p {
    margin: 5px 0;
}

/* Calendar responsive design - MOVED TO mobile.css */

/* Calendar Navigation Styles */
.calendar-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.nav-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.nav-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-btn.today-btn {
    background: #27ae60;
    margin-left: 10px;
}

.nav-btn.today-btn:hover {
    background: #219a52;
}

.month-year-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.month-selector {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    min-width: 120px;
}

.month-selector:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.year-selector {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    color: #333;
    width: 70px;
    text-align: center;
}

.year-selector:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Calendar Navigation Mobile 480px - MOVED TO mobile.css */

/* Bulk Import Styling */
.bulk-import-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.bulk-import-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 15px;
}

.bulk-import-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.5em;
}

.bulk-import-instructions {
    margin-bottom: 30px;
}

.bulk-import-instructions h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.format-table {
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.format-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.format-table th,
.format-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.format-table th {
    background: #3498db;
    color: white;
    font-weight: 600;
}

.format-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.import-notes {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.import-notes p {
    margin: 0 0 10px 0;
    color: #856404;
    font-weight: 600;
}

.import-notes ul {
    margin: 0;
    padding-left: 20px;
    color: #856404;
}

.import-notes li {
    margin-bottom: 5px;
}

.bulk-import-upload {
    margin-bottom: 30px;
}

.upload-area {
    margin-bottom: 20px;
}

.upload-drop-zone {
    border: 3px dashed #3498db;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.upload-drop-zone:hover {
    background: #e3f2fd;
    border-color: #2980b9;
}

.upload-drop-zone i {
    font-size: 3em;
    color: #3498db;
    margin-bottom: 15px;
}

.upload-drop-zone p {
    margin: 10px 0 5px 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.upload-drop-zone .file-types {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

.upload-actions {
    text-align: center;
}

.import-results {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.import-progress {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.import-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.summary-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-card.success {
    border-left: 4px solid #27ae60;
}

.summary-card.error {
    border-left: 4px solid #e74c3c;
}

.summary-card.info {
    border-left: 4px solid #3498db;
}

.summary-card.warning {
    border-left: 4px solid #f39c12;
}

.summary-card h4 {
    margin: 0 0 5px 0;
    font-size: 1.8em;
}

.summary-card p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.error-list {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.error-list h5 {
    color: #721c24;
    margin: 0 0 10px 0;
}

.error-list ul {
    margin: 0;
    padding-left: 20px;
    color: #721c24;
}

/* Bulk Import Mobile - MOVED TO mobile.css */

/* Delete All Students Button - Dangerous Action Styling */
.btn-danger.delete-all {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: 2px solid #c0392b;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-danger.delete-all:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    border-color: #a93226;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
    transform: translateY(-2px);
}

.btn-danger.delete-all:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

.btn-danger.delete-all::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-danger.delete-all:hover::before {
    left: 100%;
}

.btn-danger.delete-all i {
    margin-right: 8px;
    font-size: 14px;
}

/* Warning icon for delete all button */
.btn-danger.delete-all .warning-icon {
    color: #ffd700;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Delete All Button Mobile - MOVED TO mobile.css */

/* Mobile responsive for delete all button 480px - MOVED TO mobile.css */

/* Edit Book Modal Styles */
#editBookModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Styling for Inactive Students */
.inactive-student {
    background-color: #f8f9fa !important;
    color: #6c757d;
    text-decoration: line-through;
    opacity: 0.7;
}

.inactive-student .clickable-name, .inactive-student .class-badge {
    opacity: 0.8;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none; /* Removes the line-through */
}

.status-badge.inactive {
    background-color: #6c757d;
    color: white;
}

#editBookModal .modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

#editBookModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

#editBookModal .modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.form-actions .btn {
    min-width: 100px;
}

/* Education Actions Mobile - MOVED TO mobile.css */

/* Education Section Styles */
.education-content {
    padding: 20px 0;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.education-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.book-form-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.book-progress-list {
    margin-top: 20px;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.book-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3498db;
}

.book-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.book-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
}

.book-class {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.book-subject {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 15px;
}

.book-progress {
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
}

.book-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.book-stats .stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.book-stats .label {
    font-size: 12px;
    color: #7f8c8d;
}

.book-stats .value {
    font-weight: 600;
    color: #2c3e50;
}

.book-notes {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #856404;
}

.book-actions {
    display: flex;
    gap: 10px;
}

.book-actions .btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 40px;
}

/* Education Header Mobile - MOVED TO mobile.css */

/* Book Management Styles */
.book-management {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.add-book {
    margin-bottom: 20px;
}

.add-book .form-row {
    display: flex;
    gap: 15px;
    align-items: end;
}

.add-book .form-group {
    flex: 1;
}

.add-book .form-group:last-child {
    flex: 0 0 auto;
}

.books-list {
    max-height: 400px;
    overflow-y: auto;
}

.book-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.book-item:hover {
    background: #e9ecef;
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
}

.book-info h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.book-class {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

.book-actions {
    display: flex;
    gap: 8px;
}

.book-actions .btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Book Edit Modal Styles */
#editBookModal .modal-content,
#bookManagementEditModal .modal-content {
    max-width: 600px;
    width: 90%;
}

#editBookModal .modal-header,
#bookManagementEditModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

#editBookModal .modal-header h3,
#bookManagementEditModal .modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.form-actions .btn {
    min-width: 100px;
}

/* Book Management Mobile - MOVED TO mobile.css */

/* Teachers Corner Dropdown Styles */
.nav-item.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    z-index: 1000;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle i.fa-chevron-down {
    margin-left: 5px;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.dropdown-toggle:hover i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Book management styles */
.book-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    background: white;
}

.book-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.book-info p {
    margin: 0 0 3px 0;
    color: #666;
    font-size: 14px;
}

.book-actions {
    display: flex;
    gap: 8px;
}

.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}/* Teachers Corner styles */
.stat-card {
    background: white;
    padding: 25px 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.logbook-tabs button.active {
    border-bottom: 2px solid #3498db;
    color: #3498db;
}
.log-entry {
    border-left: 4px solid #3498db;
    transition: background-color 0.2s;
}
.log-entry:hover {
    background-color: #f0f4f8;
}
.log-entry .log-actions {
    opacity: 0;
    transition: opacity 0.2s;
}
.log-entry:hover .log-actions {
    opacity: 1;
}
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 200;
    animation: fadeIn 0.3s;
    contain: layout style paint;
}

/* Student profile modal should appear above other modals */
#student-profile-modal.modal-backdrop {
    z-index: 10001;
}

/* Enhanced student profile modal styles */
#student-profile-modal .modal-content {
    max-width: 1200px;
    min-height: 600px;
    margin: 2% auto;
}

/* Teachers Corner Layout Improvements */
#logbook-display {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

#logbook-display::-webkit-scrollbar {
    width: 6px;
}

#logbook-display::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

#logbook-display::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

#logbook-display::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Compact student list styling */
.student-list-container table th,
.student-list-container table td {
    padding: 8px 12px;
    font-size: 13px;
}

.student-list-container table th {
    font-size: 11px;
    font-weight: 600;
}

/* Log entry improvements */
.log-entry {
    border-left: 3px solid #3b82f6;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
    transition: all 0.2s ease;
}

.log-entry:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.log-type {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11px;
}

.log-date {
    color: #6b7280;
    font-size: 11px;
}

.log-details {
    color: #374151;
    line-height: 1.5;
    font-size: 13px;
}

/* Student Profile Modal Mobile - MOVED TO mobile.css */

/* Profile tab improvements for better spacing */
#student-profile-modal .profile-tab {
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

#student-profile-modal .profile-tab:hover {
    background-color: #f3f4f6;
    border-radius: 4px;
}

/* Better grid layout for profile content */
#student-profile-modal .grid {
    gap: 1rem;
}

/* Improved spacing for profile sections */
#student-profile-modal .space-y-6 > * + * {
    margin-top: 1.5rem;
}

/* Better button spacing in modal header */
#student-profile-modal .p-6.border-b {
    padding-bottom: 1rem;
}

#student-profile-modal .p-6.border-b > div:last-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.modal-content {
    animation: slideIn 0.3s;
}
@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.score-badge {
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    color: white;
    font-size: 12px;
    cursor: pointer;
}
.score-good { background-color: #27ae60; }
.score-average { background-color: #f39c12; }
.score-attention { background-color: #e74c3c; }
/* Performance optimizations */
.student-list-container {
    contain: layout;
}

/* Teachers Corner Dashboard Elements */
#teachers-corner-section {
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#class-dashboard-title {
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: bold;
}

#teachers-corner-section h3,
#teachers-corner-section h4 {
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#teachers-corner-section p,
#teachers-corner-section span,
#teachers-corner-section button {
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Progress Summary Cards */
#progress-summary .bg-blue-50,
#progress-summary .bg-green-50,
#progress-summary .bg-purple-50 {
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Education Progress Items */
#class-education-progress .bg-gray-50 {
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Dashboard Alerts */
#dashboard-alerts {
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#dashboard-alerts h3,
#dashboard-alerts p,
#dashboard-alerts button {
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Logbook Elements */
#logbook-display {
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.logbook-tabs button {
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Student List Table */
#class-student-list {
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#class-student-list th,
#class-student-list td {
    font-family: 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', 'Bangla Web', 'Nikosh', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Role-based UI restrictions - DISABLED for new permission system */
/* body.user-role .admin-only {
    display: none !important;
} */

/* Make Teachers Corner the default active section for regular users - DISABLED for new permission system */
/* body.user-role .section {
    display: none;
}

body.user-role #teachers-corner-section {
    display: block;
}

body.user-role #teachers-corner-section.active {
    display: block;
} */

/* Allow Messages section for teachers */
body.user-role #messages.active {
    display: block;
}

/* Inline Chat Interface for Teachers Corner */
.inline-chat-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inline-chat-header {
    background: #4A90E2;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e1e8ed;
}

.inline-chat-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-close:hover {
    background-color: rgba(255,255,255,0.2);
}

.inline-chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    max-height: 280px;
}

.inline-chat-messages .message {
    margin-bottom: 8px;
    display: flex;
}

.inline-chat-messages .message.sent {
    justify-content: flex-end;
}

.inline-chat-messages .message.received {
    justify-content: flex-start;
}

.inline-chat-messages .message-content {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 12px;
    position: relative;
}

.inline-chat-messages .message.sent .message-content {
    background: #4A90E2;
    color: white;
}

.inline-chat-messages .message.received .message-content {
    background: #f1f3f4;
    color: #333;
}

.inline-chat-messages .message-text {
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

.inline-chat-messages .message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
}

.inline-chat-input {
    padding: 12px;
    border-top: 1px solid #e1e8ed;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.inline-chat-input textarea {
    flex: 1;
    border: 1px solid #e1e8ed;
    border-radius: 20px;
    padding: 8px 12px;
    resize: none;
    font-size: 13px;
    max-height: 80px;
    min-height: 36px;
}

.inline-chat-input textarea:focus {
    outline: none;
    border-color: #4A90E2;
}

.inline-chat-input button {
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.inline-chat-input button:hover {
    background: #357ABD;
}

.start-conversation-content {
    padding: 20px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.start-conversation-content p {
    margin-bottom: 16px;
    color: #666;
    font-size: 14px;
}

/* Expanded widget styles */
.messaging-widget-content.expanded {
    position: relative;
}

/* Make the messaging widget more prominent in Teachers Corner */
.messaging-widget-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
}

.messaging-widget-container .widget-header {
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.messaging-widget-container .widget-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.messaging-widget-container .messaging-widget {
    background: white;
    margin: 16px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.messaging-widget .widget-header {
    background: #4A90E2;
    color: white;
    padding: 12px 16px;
    border-bottom: none;
}

.messaging-widget .widget-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.messaging-widget .widget-content {
    padding: 16px;
}

.messaging-widget .conversation-info {
    margin-bottom: 12px;
}

.messaging-widget .conversation-info p {
    margin: 4px 0;
    font-size: 13px;
    color: #666;
}

.messaging-widget .widget-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.messaging-widget .widget-actions button {
    flex: 1;
    min-width: 120px;
    font-size: 12px;
    padding: 8px 12px;
}

/* Enhanced Loading States */
.spinner-container {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-top: 8px;
}

.loading-dots span {
    width: 4px;
    height: 4px;
    background: #4A90E2;
    border-radius: 50%;
    animation: loading-dots 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-dots {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Error State */
.error-state {
    text-align: center;
    padding: 20px;
    color: #dc3545;
}

.error-state i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #dc3545;
}

.error-state p {
    margin: 8px 0;
    font-size: 14px;
}

.error-state button {
    margin-top: 12px;
    font-size: 12px;
    padding: 6px 12px;
}

/* Ghost Loading Animation */
.ghost-loading {
    animation: ghost-loading 1.5s infinite ease-in-out;
}

@keyframes ghost-loading {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* ===== MESSAGING SYSTEM STYLES ===== */

/* Navigation badge for unread messages */
.nav-badge {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
    min-width: 18px;
    text-align: center;
    line-height: 14px;
}

/* Messages container */
.messages-container {
    display: flex;
    height: calc(100vh - 200px); /* Dynamic height instead of fixed 600px */
    min-height: 400px; /* Minimum height */
    max-height: 800px; /* Maximum height */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Messages sidebar */
.messages-sidebar {
    width: 300px;
    border-right: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    background: #667eea;
    color: white;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 4px;
}

.conversation-item:hover {
    background: #e9ecef;
}

.conversation-item.active {
    background: #667eea;
    color: white;
}

.conversation-item.active .conversation-class {
    color: white;
    opacity: 0.9;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-class {
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 16px;
    text-align: center;
    line-height: 12px;
}

/* Messages main area */
.messages-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.messages-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.conversation-header-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.conversation-class {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

/* Messages content */
.messages-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    min-height: 0; /* Allow flex child to shrink */
    overflow: hidden; /* Prevent content from overflowing */
}

.messages-list {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0; /* Allow flex child to shrink below content size */
    max-height: none; /* Remove height restriction */
}

/* Message bubbles */
.message {
    display: flex;
    margin-bottom: 8px;
}

.message.own {
    justify-content: flex-end;
}

.message.other {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.message.own .message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 6px;
}

.message.other .message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 6px;
}

.message-text {
    word-wrap: break-word;
    line-height: 1.4;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.message.other .message-time {
    text-align: left;
}

/* Messages input */
.messages-input-container {
    padding: 16px;
    border-top: 1px solid #e0e0e0;
    background: white;
    flex-shrink: 0; /* Prevent input area from shrinking */
    position: relative; /* Ensure it stays at bottom */
    z-index: 10; /* Keep above other elements */
    display: block !important; /* Force visibility */
    visibility: visible !important; /* Ensure it's always visible */
    opacity: 1 !important; /* Ensure it's not transparent */
}

.messages-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 8px 12px;
    background: white;
    display: flex !important; /* Force flex display */
    visibility: visible !important; /* Ensure it's always visible */
    opacity: 1 !important; /* Ensure it's not transparent */
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    min-height: 20px;
    max-height: 120px;
    padding: 0;
    display: block !important; /* Force visibility */
    visibility: visible !important; /* Ensure it's always visible */
    opacity: 1 !important; /* Ensure it's not transparent */
}

#messageInput::placeholder {
    color: #999;
}

.send-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #5a6fd8;
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.message-counter {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 16px;
}

.empty-messages {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-messages i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-messages p {
    margin: 0;
    font-size: 18px;
}

.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-state i {
    font-size: 24px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.loading-state p {
    margin: 0;
    font-size: 14px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 250px;
    animation: slideIn 0.3s ease-out;
}

.notification-error {
    border-left: 4px solid #e74c3c;
}

.notification-success {
    border-left: 4px solid #27ae60;
}

.notification-info {
    border-left: 4px solid #3498db;
}

.notification i {
    font-size: 16px;
}

.notification-error i {
    color: #e74c3c;
}

.notification-success i {
    color: #27ae60;
}

.notification-info i {
    color: #3498db;
}

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

/* Mobile responsive design - MOVED TO mobile.css */

/* Teachers Messaging Widget Styles */
.messaging-widget-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.messaging-widget-container .widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    margin: 0;
}

.messaging-widget-container .widget-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.messaging-widget-content {
    padding: 20px;
}

.messaging-widget {
    width: 100%;
}

.messaging-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.messaging-widget .widget-header h4 {
    margin: 0;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.messaging-widget .widget-content {
    padding: 0;
}

.conversation-info {
    margin-bottom: 15px;
}

.conversation-info p {
    margin: 5px 0;
    font-size: 13px;
    color: #666;
}

.conversation-info p strong {
    color: #333;
}

.widget-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.widget-actions .btn {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.widget-actions .btn-primary {
    background: #667eea;
    color: white;
}

.widget-actions .btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.widget-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.widget-actions .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Section visibility styles */
.section {
    display: none;
}

.section.active {
    display: block;
}

/* Book Progress Modal Styles */
#book-progress-modal .modal-content {
    max-width: 1200px;
    height: 90vh;
    margin: 5% auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.book-progress-sidebar {
    background: #f9fafb;
}

.book-progress-class-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.book-progress-class-item:hover {
    background: #e5e7eb;
    border-left-color: #14b8a6;
}

.book-progress-class-item.active {
    background: #ccfbf1;
    border-left-color: #14b8a6;
    font-weight: 600;
}

.book-progress-class-name {
    font-size: 14px;
    color: #374151;
}

.book-progress-class-percentage {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.book-progress-class-percentage.high {
    background: #d1fae5;
    color: #065f46;
}

.book-progress-class-percentage.medium {
    background: #fef3c7;
    color: #92400e;
}

.book-progress-class-percentage.low {
    background: #fee2e2;
    color: #991b1b;
}

.book-progress-book-item {
    background: #f9fafb;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #14b8a6;
    transition: all 0.2s ease;
}

.book-progress-book-item:hover {
    background: #f3f4f6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.book-progress-book-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.book-progress-book-title:hover {
    background: #f3f4f6;
    color: #14b8a6;
}

.book-progress-book-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #6b7280;
}

.book-progress-bar-container {
    width: 100%;
    background: #e5e7eb;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.book-progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.book-progress-bar-fill.high {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.book-progress-bar-fill.medium {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.book-progress-bar-fill.low {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.book-progress-notes {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.book-progress-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.book-progress-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Book Progress History Styles */
.book-progress-history {
    margin-top: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #14b8a6;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.book-progress-history.show {
    display: block;
}

.book-progress-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.book-progress-history-title {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.book-progress-history-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
}

.book-progress-history-close:hover {
    color: #374151;
}

.book-progress-timeline {
    position: relative;
    padding-left: 20px;
}

.book-progress-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #d1d5db;
}

.book-progress-timeline-item {
    position: relative;
    margin-bottom: 16px;
    padding-left: 20px;
}

.book-progress-timeline-item::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #14b8a6;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #14b8a6;
}

.book-progress-timeline-date {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 4px;
}

.book-progress-timeline-details {
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
}

.book-progress-timeline-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.book-progress-timeline-bar {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.book-progress-timeline-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #14b8a6 0%, #0d9488 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.book-progress-timeline-percentage {
    font-size: 11px;
    font-weight: 600;
    color: #14b8a6;
    min-width: 35px;
}

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

/* Book Progress Modal Body */
#book-progress-modal .modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    height: calc(100% - 80px); /* Subtract header height */
}

#book-progress-modal .book-progress-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
}

#book-progress-modal .book-progress-sidebar {
    width: 250px;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    padding: 15px;
    background: #f9fafb;
    min-height: 0;
}

/* Book Progress Modal Mobile - MOVED TO mobile.css */

/* ========================================
   STUDENT PHOTO STYLING - MOBILE FIX
   ======================================== */

/* Ensure Tailwind utility classes work even if CDN fails */
.w-24 {
    width: 6rem !important; /* 96px */
}

.h-24 {
    height: 6rem !important; /* 96px */
}

.rounded-full {
    border-radius: 9999px !important;
}

.object-cover {
    object-fit: cover !important;
}

/* Specific styling for student photos to ensure they stay circular on all devices */
#student-photo-display,
img[alt="Student Photo"] {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0; /* Prevent flex container from squashing the image */
    aspect-ratio: 1 / 1; /* Maintain square aspect ratio */
    display: block; /* Remove any inline spacing */
}

/* Ensure photo placeholder is also circular */
#student-photo-placeholder,
div[id="student-photo-placeholder"] {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

/* Student Photo Mobile - MOVED TO mobile.css */

/* ========================================
   PERMISSION EDITOR MODAL STYLING
   ======================================== */

/* Permission modal specific width */
.permission-modal-content {
    max-width: 900px !important;
    width: 90% !important;
    max-height: 85vh;
    overflow-y: auto;
}

.permission-editor-body {
    padding: 20px;
}

/* Permission Templates Section */
.permission-templates {
    margin-bottom: 25px;
}

.permission-templates h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.template-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.btn-template {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.btn-template:hover {
    background: #e9ecef;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-template:active {
    transform: translateY(0);
}

/* Permission Grid */
.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.permission-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.permission-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.permission-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.permission-header i {
    color: #3498db;
    font-size: 1.2em;
}

.permission-header strong {
    color: #2c3e50;
    font-size: 0.95em;
}

.permission-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.permission-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.permission-options label:hover {
    background: #e9ecef;
}

.perm-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3498db;
}

/* Class Access Section */
.permission-classes {
    margin-top: 20px;
}

.permission-classes h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.class-access-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.class-access-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.class-access-radio:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.class-access-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3498db;
}

.class-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.class-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.class-checkboxes label:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.class-checkboxes input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3498db;
}

/* Permission Actions */
.permission-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.btn-large {
    padding: 12px 30px !important;
    font-size: 16px !important;
    font-weight: 600;
}

/* Help Text */
.help-text {
    color: #6c757d;
    font-size: 0.9em;
    margin: 5px 0 10px 0;
}

/* Permission Modal Mobile - MOVED TO mobile.css */
