/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #b3b3b3;
    color: #212529;
    line-height: 1.6;
}

/* Login Container */
.login-container {
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-form {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 100%;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.login-form:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.login-form:active {
    transform: translateY(0);
}

/* Role Selection Buttons */
.role-btn {
    padding: 1rem;
    border-radius: 15px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.role-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.role-btn:active {
    transform: translateY(0);
}

/* Portal Screens */
.portal-screen {
    min-height: 100vh;
    background-color: #f8f9fa;
}

/* Navigation Styles */
/* Teacher Portal Layout Styles */
.teacher-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: #f3f4f6;
    color: #374151;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-placeholder {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.logo-text h5 {
    color: #1f2937;
    font-weight: 600;
    margin: 0;
}

.logo-text small {
    color: #6b7280;
    font-size: 0.75rem;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.welcome-text {
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 1.2rem;
}

.teacher-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    position: relative;
}

.teacher-sidebar {
    background: white;
    width: 280px;
    border-right: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: fixed;
    left: 0;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 999;
}

.teacher-sidebar.collapsed {
    width: 70px;
}

.sidebar-content {
    padding: 1.5rem 0;
}

.sidebar-nav {
    padding: 0 1rem;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding: 0 0.75rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    color: #6b7280;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.sidebar-nav .nav-link:hover {
    background: #f3f4f6;
    color: #374151;
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-text {
    transition: opacity 0.3s ease;
}

.teacher-sidebar.collapsed .nav-text,
.teacher-sidebar.collapsed .nav-section-title {
    opacity: 0;
    pointer-events: none;
}

.teacher-sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 1rem 0.5rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.teacher-main-content {
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
    background: #f9fafb;
    min-height: calc(100vh - 80px);
}

.teacher-sidebar.collapsed + .sidebar-overlay + .teacher-main-content {
    margin-left: 70px;
}

.content-wrapper {
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stats-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.stats-icon.bg-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stats-icon.bg-success {
    background: linear-gradient(135deg, #4ade80, #22c55e);
}

.stats-icon.bg-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.stats-icon.bg-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.stats-content h3 {
    color: #1f2937;
    font-weight: 700;
    margin: 0;
    font-size: 1.8rem;
}

.stats-content p {
    color: #6b7280;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .teacher-header {
        padding: 1rem;
    }

    .logo-text {
        display: none;
    }

    .welcome-text {
        display: none;
    }

    .teacher-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .teacher-sidebar.mobile-open {
        transform: translateX(0);
    }

    .teacher-main-content {
        margin-left: 0;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .stats-card {
        padding: 1rem;
    }

    .stats-content h3 {
        font-size: 1.5rem;
    }

    .page-header {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .header-left {
        gap: 0.5rem;
    }

    .logo-placeholder {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .content-wrapper {
        padding: 0.75rem;
    }

    .stats-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .stats-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
    border-radius: 15px;
    transition: all 0.3s ease;
    border: none;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Student Portal Specific Styles */
.cartoon-character-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.cartoon-character {
    position: relative;
    animation: characterBounce 2s ease-in-out infinite;
}

@keyframes characterBounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.character-body {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
}

.character-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.eyes {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.eye {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    position: relative;
    animation: eyeBlink 3s ease-in-out infinite;
}

.eye::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    animation: eyeMove 4s ease-in-out infinite;
}

@keyframes eyeBlink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@keyframes eyeMove {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(2px); }
    75% { transform: translateX(-2px); }
}

.mouth {
    width: 16px;
    height: 8px;
    border: 2px solid white;
    border-top: none;
    border-radius: 0 0 16px 16px;
    margin: 0 auto;
    animation: mouthTalk 2s ease-in-out infinite;
}

@keyframes mouthTalk {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.5); }
}

.speech-bubble {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    min-width: 300px;
    max-width: 400px;
    animation: bubbleFloat 3s ease-in-out infinite;
    border: 3px solid #4facfe;
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateX(-50%) translateY(0px); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

.bubble-content {
    text-align: center;
}

.bubble-content .student-name {
    color: #4facfe;
    font-weight: 700;
    margin-bottom: 10px;
}

.motivational-message {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
    animation: textTypewriter 3s ease-in-out infinite;
}

@keyframes textTypewriter {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.bubble-tail {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid #4facfe;
}

.bubble-tail::after {
    content: '';
    position: absolute;
    top: -18px;
    left: -12px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid white;
}

.welcome-animation {
    animation: slideInUp 0.8s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Streak Animation */
.streak-container {
    background: linear-gradient(135deg, #ff7b7b, #ff9f43);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.streak-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(180deg); }
}

.streak-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.streak-number {
    font-size: 3rem;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.fire-animation {
    display: flex;
    gap: 0.2rem;
}

.fire-animation .fas.fa-fire {
    font-size: 2rem;
    color: #ff6b35;
    animation: fireFlicker 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255,107,53,0.8));
}

.fire-animation .fas.fa-fire:nth-child(1) {
    animation-delay: 0s;
}

.fire-animation .fas.fa-fire:nth-child(2) {
    animation-delay: 0.3s;
    color: #ff8c42;
}

.fire-animation .fas.fa-fire:nth-child(3) {
    animation-delay: 0.6s;
    color: #ffa726;
}

@keyframes fireFlicker {
    0%, 100% {
        transform: scale(1) rotate(-2deg);
        opacity: 1;
    }
    25% {
        transform: scale(1.1) rotate(2deg);
        opacity: 0.8;
    }
    50% {
        transform: scale(0.95) rotate(-1deg);
        opacity: 0.9;
    }
    75% {
        transform: scale(1.05) rotate(1deg);
        opacity: 0.7;
    }
}

/* Stat Cards */
.stat-card {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.attendance-summary {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 1rem;
}

/* QR Code Animation */
.simulate-scan {
    position: relative;
    overflow: hidden;
}

.simulate-scan::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.simulate-scan:hover::before {
    left: 100%;
}

/* Table Styles */
.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,123,255,0.05);
}

/* Badge Styles */
.badge {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* Button Animations */
.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Student Card */
.student-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.student-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.student-avatar {
    position: relative;
}

.student-avatar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(0,123,255,0.1), transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.7; }
}

/* Behavior Tags */
.behavior-tags .badge {
    margin: 0.2rem;
    animation: tagFloat 2s ease-in-out infinite;
}

.behavior-tags .badge:nth-child(1) { animation-delay: 0s; }
.behavior-tags .badge:nth-child(2) { animation-delay: 0.3s; }
.behavior-tags .badge:nth-child(3) { animation-delay: 0.6s; }

@keyframes tagFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Modal Styles */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.modal-header {
    border-bottom: 1px solid #eee;
    border-radius: 15px 15px 0 0;
}

.modal-footer {
    border-top: 1px solid #eee;
    border-radius: 0 0 15px 15px;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid #ddd;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    transform: translateY(-1px);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success Animation */
.success-checkmark {
    animation: checkmarkSlide 0.6s ease;
}

@keyframes checkmarkSlide {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Hover Effects for Interactive Elements */
.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable:hover {
    transform: scale(1.02);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Report Card Styles */
.report-card-container .card-header {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
}

.signature-line {
    border-bottom: 1px solid #333;
    height: 20px;
    margin-bottom: 5px;
}

/* Broadcast Styles */
.broadcasts-container {
    max-height: 600px;
    overflow-y: auto;
}

.broadcast-icon {
    width: 40px;
    height: 40px;
    background: rgba(0,123,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.broadcast-icon i {
    font-size: 1.2rem;
}

/* Homework Styles */
.homework-section {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.homework-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #007bff;
    transition: all 0.3s ease;
}

.homework-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.homework-toggle {
    transition: all 0.3s ease;
    min-width: 100px;
}

.homework-toggle:hover {
    transform: scale(1.05);
}

/* Curriculum Styles */
.curriculum-card {
    transition: all 0.3s ease;
}

.curriculum-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.curriculum-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin: 0.1rem;
}

/* Mobile App-Style Parent Portal */
#parentPortal {
    background: #f5f7fa;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    /* Force mobile-like padding and overflow for all screen sizes */
    padding-bottom: 120px; /* Adjusted based on typical bottom nav height + some margin */
    overflow-y: auto; /* Enable scrolling for content */
}

/* This is the mobile header, which should be hidden on desktop for a cleaner look if a sidebar nav exists */
.mobile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    flex-shrink: 0;
    display: flex; /* Always display the mobile header */
    
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.profile-info h6 {
    color: white;
    margin: 0;
    font-weight: 600;
}

.profile-info small {
    color: rgba(255,255,255,0.8);
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.mobile-content {
    padding: 1rem;
    /* This padding will ensure content is visible above the bottom fixed nav on mobile */
    padding-bottom: 120px; /* Adjusted based on typical bottom nav height + some margin */
    max-width: 100%;
    overflow-x: visible;
    flex: 1;
    overflow-y: auto; /* Enable scrolling for content */
    margin-bottom: 100px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card-mobile {
    background: white;
    padding: 1.5rem 1rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card-mobile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.2rem;
}

.stat-icon.attendance {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.stat-icon.grades {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: white;
}

.stat-icon.homework {
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: white;
}

.stat-info h4 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

.stat-info span {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
}

/* Child Profile Card */
.child-profile-card {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    text-align: center;
}

.child-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.child-info h5 {
    margin: 0 0 0.5rem;
    color: #2d3748;
    font-weight: 600;
}

.child-info p {
    color: #718096;
    margin: 0 0 1rem;
}

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #ff7b7b, #ff9f43);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.streak-badge i {
    animation: fireFlicker 1.5s ease-in-out infinite;
}

/* Performance Section */
.performance-section {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.section-title {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.subject-progress {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.subject-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subject-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subject-name {
    font-weight: 500;
    color: #2d3748;
}

.subject-grade {
    font-weight: 600;
    color: #4299e1;
}

.progress-bar-custom {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    border-radius: 10px;
    transition: width 0.8s ease;
}

/* Parent Report Card Container - NEW STYLES */
.parent-report-card-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 2rem;
}

.report-card-header {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
    padding: 2rem;
    text-align: center;
}

.school-info-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.school-logo {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.school-details h4, .school-details h5, .school-details h6 {
    margin: 0.25rem 0;
    font-weight: 700;
}

.school-details h4 {
    font-size: 1.5rem;
}

.school-details h5 {
    font-size: 1.2rem;
}

.school-details h6 {
    font-size: 1rem;
    opacity: 0.9;
}

.student-info-section {
    padding: 2rem;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.student-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px dotted #cbd5e0;
}

.student-detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.student-detail-label {
    font-weight: 600;
    color: #4a5568;
}

.student-detail-value {
    color: #2d3748;
    font-weight: 500;
}

.grades-breakdown-section {
    padding: 2rem;
}

.grade-category {
    margin-bottom: 2rem;
}

.grade-category:last-child {
    margin-bottom: 0;
}

.category-title {
    background: #edf2f7;
    color: #2d3748;
    padding: 1rem;
    margin: 0 -2rem 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    border-left: 4px solid #4299e1;
}

.grade-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.grade-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.grade-item:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.grade-item .subject {
    flex: 1;
    font-weight: 600;
    color: #2d3748;
}

.grade-item .score {
    font-weight: 700;
    color: #4a5568;
    margin-right: 1rem;
    font-size: 1.1rem;
}

.grade {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: white;
}

.grade-a { background: linear-gradient(135deg, #10b981, #059669); }
.grade-b { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.grade-c { background: linear-gradient(135deg, #f59e0b, #d97706); }
.grade-d { background: linear-gradient(135deg, #ef4444, #dc2626); }
.grade-e { background: linear-gradient(135deg, #6b7280, #4b5563); }

/* Signature Section Styles - NEW */
.signature-section {
    background: #f8fafc;
    padding: 2rem;
    border-top: 2px solid #e2e8f0;
}

.signature-status-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 12px;
}

.signature-status-indicator.signed {
    background: #d1e7dd;
    border-color: #a3cfbb;
}

.status-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.status-text strong {
    color: #2d3748;
    font-size: 1.1rem;
}

.status-text p {
    margin: 0.25rem 0 0;
    color: #4a5568;
    font-size: 0.9rem;
}

.signature-area {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

.signature-fields {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.signature-field label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.signature-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.signature-input, .date-input {
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.signature-input:focus, .date-input:focus {
    border-color: #4299e1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.signature-actions {
    text-align: center;
}

.signature-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.signature-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.signed-confirmation {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #d1e7dd;
    border: 1px solid #a3cfbb;
    border-radius: 12px;
}

.signed-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #198754;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.signed-details strong {
    color: #155724;
    font-size: 1.1rem;
}

.signed-details p {
    margin: 0.25rem 0 0;
    color: #0f5132;
    font-size: 0.9rem;
}

/* NEW TICKET SYSTEM STYLES */
.tickets-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1rem; /* Space before bottom nav on mobile */
}

.ticket-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid; /* Color will be dynamic based on status */
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.ticket-card.status-open { border-color: #3b82f6; } /* blue */
.ticket-card.status-pending { border-color: #f59e0b; } /* yellow */
.ticket-card.status-closed { border-color: #6b7280; } /* gray */

.ticket-card-info h6 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.ticket-card-info small {
    color: #718096;
}

.ticket-card-status .badge {
    min-width: 80px;
    text-align: center;
}

.ticket-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ticket-detail-status .badge {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

.response-item {
    background: #e2e8f0;
    padding: 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.response-item.teacher {
    background: #d1e7dd; /* Light green for teacher responses */
    text-align: right;
}

.response-item.parent {
    background: #e0f2f7; /* Light blue for parent responses */
    text-align: left;
}

.response-author {
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: block;
}

.response-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.5rem;
    display: block;
}

/* Adjustments for modals with new ticket content */
#ticketDetailsModal .modal-body {
    padding-top: 1.5rem;
}

#ticketDetailsModal .modal-footer {
    border-top: none;
    padding-top: 0.5rem;
}

/* Teacher Portal Tickets Tab */
#teacherTicketsContainer .ticket-card {
    border-color: #667eea; /* default color for teacher view */
}

/* NEW STUDENT MANAGEMENT STYLES */
#students-management .table th {
    white-space: nowrap; /* Prevent wrapping in table headers */
}

#students-management .table td {
    white-space: nowrap; /* Prevent wrapping in table cells */
    max-width: 150px; /* Limit width for text content */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis for overflow */
}

/* NEW REPORT CARD MODAL TABLE STYLES */
.report-card-subjects-table .form-check-input {
    transform: scale(1.2); /* Slightly larger checkbox */
    margin-right: 0.5rem;
}

.report-card-subjects-table .form-control-sm {
    max-width: 80px; /* Limit width for score input */
}

.report-card-subjects-table td {
    vertical-align: middle;
}

.report-card-subjects-table .score-percentage {
    font-weight: 600;
    min-width: 50px; /* Ensure space for percentage */
    text-align: right;
}


/* --- START PARENT PORTAL BOTTOM NAVIGATION BAR STYLES --- */
/* Mobile First: Fixed bottom navigation with full styling */
.bottom-nav {
    position: fixed; /* Keeps it locked to the viewport */
    bottom: 0;
    left: 0;
    right: 0;
    background: white; /* White background */
    border-top: 1px solid #e2e8f0; /* Top border */
    padding: 0.75rem 0;
    display: flex; /* Flexbox for alignment */
    justify-content: space-around; /* Distribute items evenly */
    align-items: center; /* Center items vertically */
    z-index: 1000; /* Ensure it stays on top */
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1); /* Subtle shadow */
    flex-shrink: 0; /* Prevent shrinking */
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border: none;
    background: none;
    color: #718096; /* Default icon/text color */
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 12px;
    min-width: 60px;
}

.bottom-nav .nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.bottom-nav .nav-item.active {
    color: #667eea; /* Active item color */
    background: rgba(102, 126, 234, 0.1); /* Active item background */
}

.bottom-nav .nav-item:hover {
    color: #667eea; /* Hover color */
    transform: translateY(-2px); /* Slight lift on hover */
}

/* Desktop View: Keep parent portal content within a mobile-like max-width */
@media (min-width: 769px) {
    #parentPortal {
        max-width: 500px; /* Max width for desktop view to mimic mobile */
        margin: 0 auto; /* Center the content */
        box-shadow: 0 0 20px rgba(0,0,0,0.1); /* Add a subtle shadow to make it look like a contained app */
        border-radius: 10px; /* Rounded corners for the "device" look */
        overflow: hidden; /* Hide overflowing content */
    }

    .mobile-header {
        width: 100%; /* Ensure header takes full width within the max-width container */
    }

    .mobile-content {
        width: 100%; /* Ensure content takes full width within the max-width container */
        padding-bottom: 120px; /* Maintain padding for bottom nav */
    }

    .bottom-nav {
        max-width: 500px; /* Match the max-width of the #parentPortal */
        left: 50%; /* Center the bottom nav */
        transform: translateX(-50%); /* Adjust for centering */
    }
}


/* Responsive Mobile Specifics (apply only to screens <= 768px) */
@media (max-width: 768px) {
    .login-form {
        margin: 1rem;
        padding: 2rem;
    }

    .streak-number {
        font-size: 2rem;
    }

    .fire-animation .fas.fa-fire {
        font-size: 1.5rem;
    }

    .sidebar-nav {
        margin-bottom: 2rem;
    }

    .sidebar-nav .nav-link {
        text-align: center;
    }

    /* Optimize parent portal for mobile */
    .homework-section {
        margin: 1rem 0;
        padding: 1rem;
    }

    .homework-item {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .homework-toggle {
        min-width: 80px;
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }

    .curriculum-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }

    .stats-grid {
        gap: 0.75rem;
    }

    .child-profile-card {
        padding: 1rem;
    }

    .child-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .performance-section,
    .parent-report-card-container,
    .curriculum-mobile {
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .broadcast-item {
        padding: 1rem;
    }

    .mobile-content {
        padding: 0.75rem;
        /* This padding is crucial to make space for the fixed bottom nav on mobile */
        padding-bottom: 120px; /* IMPORTANT: Ensures content is not hidden by bottom nav on mobile */
    }

    /* Adjust students table for mobile */
    #students-management .table-responsive {
        overflow-x: auto; /* Enable horizontal scroll for table */
    }

    #students-management .table th,
    #students-management .table td {
        font-size: 0.85rem; /* Smaller font size for mobile table */
        padding: 0.75rem 0.5rem;
    }

    /* Mobile-specific parent report card adjustments */
    .parent-report-card-container {
        margin-bottom: 2rem;
    }

    .signature-section {
        padding: 1.5rem;
    }

    .signature-fields {
        gap: 1rem;
    }

    .signature-input, .date-input {
        padding: 0.75rem;
    }
}

/* Further Mobile Optimization for very small screens */
@media (max-width: 576px) {
    .container-fluid {
        padding: 0.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .navbar .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }

    h4 {
        font-size: 1.2rem;
    }

    .speech-bubble {
        min-width: 250px;
        max-width: 300px;
        padding: 15px;
        top: -100px;
    }

    .character-body {
        width: 60px;
        height: 60px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .stat-card-mobile {
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
        padding: 1rem;
    }

    .stat-icon {
        margin: 0;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .bottom-nav .nav-item span {
        font-size: 0.7rem;
    }

    .bottom-nav .nav-item i {
        font-size: 1.1rem;
    }

    .mobile-content {
        padding: 0.5rem;
        padding-bottom: 120px; /* Ensures content is not hidden by bottom nav on mobile */
    }

    /* Very small screen parent report card adjustments */
    .parent-report-card-container {
        border-radius: 15px;
    }

    .report-card-header {
        padding: 1.5rem;
    }

    .school-logo {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .school-details h4 {
        font-size: 1.2rem;
    }

    .school-details h5 {
        font-size: 1rem;
    }

    .student-info-section, .grades-breakdown-section {
        padding: 1.5rem;
    }

    .category-title {
        margin: 0 -1.5rem 1rem;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .grade-item {
        padding: 0.75rem;
    }

    .grade {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}
/* --- END PARENT PORTAL BOTTOM NAVIGATION BAR STYLES --- */

/* Custom styles for the scanning animation */
.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px; /* Thickness of the scanning line */
    background: linear-gradient(to right, transparent, #4CAF50, transparent); /* Green gradient line */
    animation: scan 2s infinite linear; /* Scanning animation */
    transform-origin: top;
}

@keyframes scan {
    0% {
        transform: translateY(0%);
    }
    50% {
        transform: translateY(calc(100% - 2px)); /* Move down to the bottom of the container */
    }
    100% {
        transform: translateY(0%);
    }
}

/* Styling for the camera feed container */
.camera-container {
    position: relative;
    max-width: 500px; /* Limit max width for better display on larger screens */
    margin-left: 70px;
    aspect-ratio: 1 / 1; /* Make it square or adjust as needed */
    overflow: hidden;
    border-radius: 1rem; /* Rounded corners */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    margin-bottom: 30px;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure the video covers the container */
    transform: scaleX(-1); /* Mirror the camera feed for a more natural feel */
}

.scanner-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%; /* Size of the scanning frame */
    height: 70%;
    border: 2px solid #4CAF50; /* Green border for the scanning frame */
    box-sizing: border-box;
    border-radius: 0.5rem; /* Slightly rounded corners for the frame */
    z-index: 10; /* Ensure it's above the video */
}

@media (max-width: 576px) {
    .camera-container {
        margin-left: 0px;
    }
}
@media (max-width: 576px) { }



#pdf-content {
    display: none; /* Hide this div from normal view */
    width: 210mm; /* A4 width */
    min-height: 297mm; /* A4 height */
    box-sizing: border-box;
    background-color: #fff;
    font-family: 'Times New Roman', serif;
    color: #333;
    font-size: 12pt;
    /* Border is now applied to the inner div for better control with html2canvas */
}

#pdf-content .pdf-inner-content {
    border: 5mm solid #f0f0f0; /* Border to mimic the image */
    padding: 10mm; /* Adjusted padding within the border */
    margin: 5mm; /* Margin outside the border */
    box-sizing: border-box;
}

#pdf-content h1, #pdf-content h2, #pdf-content h3, #pdf-content h4, #pdf-content h5, #pdf-content h6 {
    text-align: center;
    margin-bottom: 10px;
    color: #222;
}

#pdf-content .section-title {
    font-weight: bold;
    text-decoration: underline;
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: left;
}

/* Table styling for PDF content */
#pdf-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}
#pdf-content table, #pdf-content th, #pdf-content td {
    border: 1px solid #000; /* Ensure borders are black */
}
#pdf-content th, #pdf-content td {
    padding: 8px;
    text-align: left;
}
#pdf-content th {
    background-color: #FFFFAA; /* Yellow header background */
    font-weight: bold;
}
#pdf-content .text-center {
    text-align: center;
}
#pdf-content .signature-line {
    border-bottom: 1px solid #000;
    width: 60%;
    margin-top: 50px;
    margin-bottom: 5px;
}
#pdf-content .signature-name {
    font-weight: bold;
    margin-bottom: 3px;
}
#pdf-content .signature-title {
    font-size: 0.9em;
    margin-bottom: 20px;
}
#pdf-content .footer-text {
    margin-top: 50px;
    font-size: 0.9em;
}


/* Add these styles to your existing CSS file (style.css) */

/* Modern UI for Broadcasts */
.broadcasts-mobile .section-header {
    margin-bottom: 1.5rem;
}

.broadcasts-mobile .section-header h6 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.broadcasts-mobile .section-header p {
    font-size: 0.95rem;
    color: #666;
}

.broadcast-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
    cursor: pointer; /* Indicate clickability */
    position: relative;
    overflow: hidden; /* For potential hover effects */
}

.broadcast-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.broadcast-item:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.broadcast-icon {
    width: 48px;
    height: 48px;
    min-width: 48px; /* Ensure icon doesn't shrink */
    background: rgba(102, 126, 234, 0.15); /* Soft background */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #667eea; /* Primary color for icons */
}

/* Specific icon colors */
.broadcast-item.urgent .broadcast-icon {
    background: rgba(255, 99, 71, 0.15); /* Tomato red */
    color: #ff6347;
}

.broadcast-item.event .broadcast-icon {
    background: rgba(60, 179, 113, 0.15); /* MediumSeaGreen */
    color: #3cb371;
}

.broadcast-item.general .broadcast-icon {
    background: rgba(30, 144, 255, 0.15); /* DodgerBlue */
    color: #1e90ff;
}

/* New: Picture Day icon style */
.broadcast-item.picture-day .broadcast-icon {
    background: rgba(255, 204, 0, 0.2); /* Gold-ish */
    color: #FFD700;
}


.broadcast-content {
    flex-grow: 1;
}

.broadcast-content h6 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.broadcast-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

.broadcast-meta {
    display: flex;
    justify-content: flex-start; /* Align meta tags to the left */
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #888;
}

.broadcast-meta .category {
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    text-transform: uppercase;
}

.broadcast-meta .category.urgent {
    background: #ffe0e0;
    color: #cc0000;
}

.broadcast-meta .category.event {
    background: #e0ffe0;
    color: #008000;
}

.broadcast-meta .category.general {
    background: #e0f0ff;
    color: #0056b3;
}

/* New: Picture Day category badge */
.broadcast-meta .category.picture-day {
    background: #fffacd;
    color: #b8860b;
}

/* Modal for Announcement Details/Gallery */
#announcementDetailModal .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

#announcementDetailModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    padding: 1.5rem;
    position: relative; /* For the close button styling */
}

#announcementDetailModal .modal-title {
    font-weight: 700;
    font-size: 1.5rem;
}

#announcementDetailModal .btn-close {
    filter: invert(1); /* Makes the close icon white */
    opacity: 0.8;
}

#announcementDetailModal .modal-body {
    padding: 2rem;
    background-color: #f8f9fa;
}

#announcementDetailModal .modal-body img.poster-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#announcementDetailModal .modal-body .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 1.5rem;
}

#announcementDetailModal .modal-body .gallery-grid img {
    width: 100%;
    height: 100px; /* Fixed height for gallery thumbnails */
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#announcementDetailModal .modal-body .gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#announcementDetailModal .modal-body .gallery-grid img.selected-thumbnail {
    border: 2px solid #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

#announcementDetailModal .modal-body .main-gallery-image-container {
    text-align: center;
    margin-bottom: 1.5rem;
    background-color: #e9ecef;
    border-radius: 12px;
    padding: 10px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

#announcementDetailModal .modal-body img.main-gallery-image {
    max-width: 100%;
    height: auto;
    max-height: 400px; /* Limit height for main gallery image */
    object-fit: contain; /* Ensure entire image is visible */
    border-radius: 8px;
    animation: fadeIn 0.5s ease;
}

/* Lightbox for full-size image when clicked */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top */
    padding-top: 60px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close-lightbox {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close-lightbox:hover,
.close-lightbox:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .broadcast-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .broadcast-icon {
        margin-bottom: 0.75rem;
    }
    .broadcast-meta {
        justify-content: center;
    }
    #announcementDetailModal .modal-body {
        padding: 1rem;
    }
    #announcementDetailModal .modal-title {
        font-size: 1.2rem;
    }
    #announcementDetailModal .modal-header {
        padding: 1rem;
    }
    #announcementDetailModal .modal-body .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 5px;
    }
    #announcementDetailModal .modal-body .gallery-grid img {
        height: 70px;
    }
}

/* NEW: AI Report Button Container */
.ai-report-button-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background-color: white;
    border-top: 1px solid #e5e7eb;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Adjust sidebar padding to accommodate the new button */
.teacher-sidebar {
    padding-bottom: 70px; /* Adjust this value based on the button height */
}

/* Hide the button text when the sidebar is collapsed */
.teacher-sidebar.collapsed .ai-report-button-container .btn span {
    display: none;
}

.teacher-sidebar.collapsed .ai-report-button-container .btn {
    width: 50px !important;
    height: 50px;
    border-radius: 50%;
    padding: 0;
}

.teacher-sidebar.collapsed .ai-report-button-container .btn i {
    margin-right: 0 !important;
}

/* Style the AI report display in the modal to mimic the report card */
#aiReportDisplay {
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.ai-report-print-area {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 1rem;
}

.ai-report-section {
    margin-bottom: 1.5rem;
}

.ai-report-section h6 {
    font-weight: 700;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.ai-report-section p {
    margin-bottom: 0.5rem;
}

.ai-report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.ai-report-table th, .ai-report-table td {
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    text-align: left;
}

.ai-report-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #667eea;
}

/* From Uiverse.io by MuhammadHasann */
.for-ai-button {

  --border_radius: 9999px;
  --transtion: 0.3s ease-in-out;
  --offset: 2px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform-origin: center;
  padding: 1rem 2rem;
  background-color: hsla(260 97% 61% / 0.75);
  border: none;
  border-radius: var(--border_radius);
  transform: scale(calc(1 + (var(--active, 0) * 0.1)));
  transition: transform var(--transtion);
  width: 100%;
}

.for-ai-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background-color: hsla(260 97% 61% / 0.75);
  background-image: radial-gradient(
      at 51% 89%,
      hsla(266, 45%, 74%, 1) 0px,
      transparent 50%
    ),
    radial-gradient(at 100% 100%, hsla(266, 36%, 60%, 1) 0px, transparent 50%),
    radial-gradient(at 22% 91%, hsla(266, 36%, 60%, 1) 0px, transparent 50%);
  border-radius: var(--border_radius);
  box-shadow: inset 0 0.5px hsl(0, 0%, 100%), inset 0 -1px 2px 0 hsl(0, 0%, 0%),
    0px 4px 10px -4px hsla(0 0% 0% / calc(1 - var(--active, 0))),
    0 0 0 calc(var(--active, 0) * 0.375rem) hsl(260 97% 50% / 0.75);
  transition: all var(--transtion);
  z-index: 0;
}

.for-ai-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background-color: hsla(260 97% 61% / 0.75);
  background-image: radial-gradient(
      at 51% 89%,
      hsla(266, 45%, 74%, 1) 0px,
      transparent 50%
    ),
    radial-gradient(at 100% 100%, hsla(266, 36%, 60%, 1) 0px, transparent 50%),
    radial-gradient(at 22% 91%, hsla(266, 36%, 60%, 1) 0px, transparent 50%);
  background-position: top;
  opacity: var(--active, 0);
  border-radius: var(--border_radius);
  transition: opacity var(--transtion);
  z-index: 2;
}

.for-ai-button:is(:hover, :focus-visible) {
  --active: 1;
}

.for-ai-button:active {
  transform: scale(1);
}

.for-ai-button .for-ai-button-dots_border {
  --size_border: calc(100% + 2px);
  overflow: hidden;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--size_border);
  height: var(--size_border);
  background-color: transparent;
  border-radius: var(--border_radius);
  z-index: -10;
}

.for-ai-button .for-ai-button-dots_border::before {
  content: "";
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: left;
  transform: rotate(0deg);
  width: 100%;
  height: 2rem;
  background-color: white;
  mask: linear-gradient(transparent 0%, white 120%);
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

.for-ai-button .for-ai-button-sparkle {
  position: relative;
  z-index: 10;
  width: 1.75rem;
}

.for-ai-button .for-ai-button-sparkle .for-ai-button-path {
  fill: currentColor;
  stroke: currentColor;
  transform-origin: center;
  color: hsl(0, 0%, 100%);
}

.for-ai-button:is(:hover, :focus) .for-ai-button-sparkle .for-ai-button-path {
  animation: path 1.5s linear 0.5s infinite;
}

.for-ai-button .for-ai-button-sparkle .for-ai-button-path:nth-child(1) {
  --scale_path_1: 1.2;
}

.for-ai-button .for-ai-button-sparkle .for-ai-button-path:nth-child(2) {
  --scale_path_2: 1.2;
}

.for-ai-button .for-ai-button-sparkle .for-ai-button-path:nth-child(3) {
  --scale_path_3: 1.2;
}

@keyframes path {
  0%,
  34%,
  71%,
  100% {
    transform: scale(1);
  }
  17% {
    transform: scale(var(--scale_path_1, 1));
  }
  49% {
    transform: scale(var(--scale_path_2, 1));
  }
  83% {
    transform: scale(var(--scale_path_3, 1));
  }
}

.for-ai-button .for-ai-button-text_button {
  position: relative;
  z-index: 10;
  background-image: linear-gradient(
    90deg,
    hsla(0 0% 100% / 1) 0%,
    hsla(0 0% 100% / var(--active, 0)) 120%
  );
  background-clip: text;
  font-size: 1rem;
  color: white;
}