/**
 * School Schedule Kiosk Styles
 * Responsive, accessible design with Macedonian language support
 */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background-color: #f9fafb;
    color: #1f2937;
    overflow: hidden; /* Prevent scrolling in kiosk mode */
}

/* Kiosk container */
.kiosk-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Loading screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #1f2937;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #374151;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header with announcements */
.kiosk-header {
    background-color: #1f2937;
    color: white;
    height: 80px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.announcement-ticker {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    transition: opacity 0.3s ease;
}

.announcement-ticker.fade-out {
    opacity: 0;
}

.announcement-ticker.fade-in {
    opacity: 1;
}

.announcement-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.announcement-text {
    font-size: 1.5rem;
    font-weight: 500;
    white-space: nowrap;
    animation: scroll-left 30s linear infinite;
    padding: 0 2rem;
    border-radius: 0.25rem;
    display: inline-block;
    line-height: 1.2;
}

/* Priority-based styling */
.announcement-content.priority-normal .announcement-text {
    background-color: transparent;
    color: #ffffff;
}

.announcement-content.priority-high .announcement-text {
    background-color: #f59e0b;
    color: #ffffff;
    font-weight: 600;
    animation: scroll-left 30s linear infinite, pulse-glow 2s infinite;
}

.announcement-content.priority-urgent .announcement-text {
    background-color: #dc2626;
    color: #ffffff;
    font-weight: 700;
    animation: scroll-left 30s linear infinite, pulse-urgent 1.5s infinite;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

.announcement-content.urgent .announcement-text {
    animation: scroll-left 30s linear infinite, pulse-urgent 1.5s infinite;
}

.announcement-timestamp {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 0.75rem;
    color: #d1d5db;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

.no-announcements {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-announcements-text {
    font-size: 1.25rem;
    color: #9ca3af;
    font-style: italic;
}

/* Animations */
@keyframes scroll-left {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

@keyframes pulse-glow {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
    }
    50% { 
        opacity: 0.9;
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
    }
}

@keyframes pulse-urgent {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
        transform: scale(1);
    }
    50% { 
        opacity: 0.95;
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.8);
        transform: scale(1.01);
    }
}

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

/* Main content area */
.kiosk-main {
    flex: 1;
    padding: 1rem;
    overflow: hidden;
}

/* Schedule grid */
.schedule-grid {
    display: grid;
    grid-template-columns: 120px repeat(5, 1fr);
    grid-template-rows: 60px repeat(10, 1fr);
    gap: 2px;
    height: 100%;
    background-color: #e5e7eb;
}

.grid-header {
    background-color: #374151;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem;
}

.time-header {
    background-color: #1f2937;
}

.day-header {
    text-transform: capitalize;
}

.period-time {
    background-color: #f3f4f6;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.time-slot {
    padding: 0.25rem;
    margin: 1px 0;
    border-radius: 0.25rem;
    text-align: center;
    font-size: 0.75rem;
}

.time-slot.shift-1 {
    background-color: #dbeafe;
    color: #1e40af;
}

.time-slot.shift-2 {
    background-color: #dcfce7;
    color: #166534;
}

.day-period {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.period-cell {
    background-color: white;
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    flex: 1;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.period-cell.empty {
    background-color: #f9fafb;
    border-style: dashed;
}

.period-cell.shift-1 {
    background-color: #dbeafe;
    border-color: #93c5fd;
}

.period-cell.shift-2 {
    background-color: #dcfce7;
    border-color: #86efac;
}

.period-cell.current-period {
    background-color: #fef3c7;
    border: 2px solid #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    animation: highlight-pulse 2s infinite;
}

@keyframes highlight-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.subject {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: #1f2937;
}

.class-room {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.125rem;
}

.teacher {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
}

/* Footer */
.kiosk-footer {
    background-color: #374151;
    color: white;
    height: 70px; /* Increased from 60px */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0; /* Prevent footer from shrinking */
    z-index: 10; /* Ensure footer stays on top */
}

.footer-left, .footer-center, .footer-right {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 50px; /* Ensure minimum height for content */
}

.footer-center {
    justify-content: center;
}

.footer-right {
    justify-content: flex-end;
}

/* Clock display */
.clock-display {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center align clock content */
    min-height: 50px;
    justify-content: center;
}

.clock-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3; /* Better line spacing */
}

.date-display {
    font-size: 0.875rem;
    color: #d1d5db;
    line-height: 1.2;
    margin-bottom: 0.25rem; /* Add spacing between date and time */
}

.time-display {
    font-size: 1.5rem; /* Increased from 1.25rem */
    font-weight: 600;
    color: white;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* Add text shadow for better visibility */
}

/* Legacy support for existing date/time classes */
.date {
    font-size: 0.875rem;
    color: #d1d5db;
    margin-bottom: 0.25rem;
}

.time {
    font-size: 1.5rem; /* Increased from 1.25rem */
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Countdown timer */
.countdown-timer {
    text-align: center;
}

.countdown-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: #fbbf24;
}

.no-period {
    font-size: 1rem;
    color: #9ca3af;
}

/* Connection status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ef4444;
}

.status-indicator.online {
    background-color: #10b981;
}

.status-indicator.offline {
    background-color: #ef4444;
}

.status-text {
    font-size: 0.875rem;
    color: #d1d5db;
}

/* Admin overlay (hidden by default) */
.admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-overlay.hidden {
    display: none;
}

/* Error message */
.error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #dc2626;
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    z-index: 2000;
    font-size: 1.125rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.error-message.hidden {
    display: none;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Keyboard navigation hints */
.keyboard-navigation-hint {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.period-cell:focus .keyboard-navigation-hint {
    opacity: 1;
}

.period-cell {
    position: relative;
}

/* Enhanced focus styles for better visibility */
.period-cell:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
    z-index: 10;
    position: relative;
}

/* High contrast mode focus styles */
.high-contrast-mode .period-cell:focus {
    outline-color: #ff0000 !important;
    outline-width: 4px !important;
}

/* Focus styles for buttons and interactive elements */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

.high-contrast-mode button:focus,
.high-contrast-mode input:focus,
.high-contrast-mode select:focus,
.high-contrast-mode textarea:focus,
.high-contrast-mode a:focus {
    outline-color: #ff0000 !important;
    outline-width: 4px !important;
}

/* Ensure interactive elements have minimum touch target size */
button,
input,
select,
textarea,
a,
.period-cell {
    min-height: 44px;
    min-width: 44px;
}

/* Screen reader mode enhancements */
.screen-reader-mode .announcement-text {
    animation-play-state: paused;
}

.screen-reader-mode .loading-spinner {
    animation-play-state: paused;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== RESPONSIVE DESIGN - MOBILE FIRST ===== */

/* Base styles are mobile-first (320px+) */

/* Touch-friendly interface elements */
.btn, .nav-item, .period-cell, .announcement-text {
    min-height: 44px; /* Apple's recommended minimum touch target */
    min-width: 44px;
}

.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.98);
}

/* Touch-friendly period cells */
.period-cell {
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.period-cell:hover,
.period-cell:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.period-cell:active {
    transform: translateY(0);
}

/* Mobile-first base layout (320px - 479px) */
.kiosk-container {
    font-size: 14px;
}

.schedule-grid {
    grid-template-columns: 50px repeat(2, 1fr);
    grid-template-rows: 35px repeat(10, minmax(50px, 1fr));
    gap: 1px;
    font-size: 0.75rem;
}

.grid-header {
    font-size: 0.75rem;
    padding: 0.25rem;
}

.period-cell {
    padding: 0.25rem;
    min-height: 50px;
}

.subject {
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.2;
}

.class-room, .teacher {
    font-size: 0.5rem;
    line-height: 1.1;
}

.kiosk-header {
    height: 50px;
}

.announcement-text {
    font-size: 0.875rem;
    padding: 0 1rem;
}

.kiosk-footer {
    height: 60px; /* Increased from 50px */
    flex-direction: column;
    padding: 0.5rem; /* Increased padding */
    gap: 0.25rem;
}

.footer-left, .footer-center, .footer-right {
    justify-content: center;
    font-size: 0.75rem;
}

/* Small mobile (480px+) */
@media (min-width: 480px) {
    .kiosk-container {
        font-size: 15px;
    }
    
    .schedule-grid {
        grid-template-columns: 60px repeat(3, 1fr);
        grid-template-rows: 40px repeat(10, minmax(55px, 1fr));
        gap: 1px;
    }
    
    .grid-header {
        font-size: 0.875rem;
        padding: 0.375rem;
    }
    
    .period-cell {
        padding: 0.375rem;
        min-height: 55px;
    }
    
    .subject {
        font-size: 0.75rem;
    }
    
    .class-room, .teacher {
        font-size: 0.625rem;
    }
    
    .kiosk-header {
        height: 60px;
    }
    
    .announcement-text {
        font-size: 1rem;
    }
    
    .kiosk-footer {
        height: 60px;
        flex-direction: row;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .footer-left, .footer-center, .footer-right {
        font-size: 0.875rem;
    }
}

/* Tablet portrait (768px+) */
@media (min-width: 768px) {
    .kiosk-container {
        font-size: 16px;
    }
    
    .schedule-grid {
        grid-template-columns: 80px repeat(5, 1fr);
        grid-template-rows: 50px repeat(10, minmax(60px, 1fr));
        gap: 2px;
    }
    
    .grid-header {
        font-size: 1rem;
        padding: 0.5rem;
    }
    
    .period-cell {
        padding: 0.5rem;
        min-height: 60px;
    }
    
    .subject {
        font-size: 0.875rem;
    }
    
    .class-room, .teacher {
        font-size: 0.75rem;
    }
    
    .kiosk-header {
        height: 70px;
    }
    
    .announcement-text {
        font-size: 1.25rem;
    }
    
    .kiosk-footer {
        height: 60px;
        padding: 0.75rem 1rem;
    }
    
    .footer-left, .footer-center, .footer-right {
        font-size: 1rem;
    }
}

/* Tablet landscape / Small desktop (1024px+) */
@media (min-width: 1024px) {
    .schedule-grid {
        grid-template-columns: 100px repeat(5, 1fr);
        grid-template-rows: 60px repeat(10, minmax(70px, 1fr));
        gap: 2px;
    }
    
    .grid-header {
        font-size: 1.1rem;
        padding: 0.5rem;
    }
    
    .period-cell {
        padding: 0.5rem;
        min-height: 70px;
    }
    
    .subject {
        font-size: 0.875rem;
    }
    
    .class-room, .teacher {
        font-size: 0.75rem;
    }
    
    .kiosk-header {
        height: 80px;
    }
    
    .announcement-text {
        font-size: 1.5rem;
    }
    
    .kiosk-footer {
        height: 60px;
        padding: 0 2rem;
    }
}

/* Desktop (1280px+) */
@media (min-width: 1280px) {
    .schedule-grid {
        grid-template-columns: 120px repeat(5, 1fr);
        grid-template-rows: 60px repeat(10, minmax(80px, 1fr));
    }
    
    .period-cell {
        min-height: 80px;
    }
    
    .subject {
        font-size: 1rem;
    }
    
    .class-room, .teacher {
        font-size: 0.875rem;
    }
}

/* Large desktop / Kiosk displays (1440px+) */
@media (min-width: 1440px) {
    .schedule-grid {
        grid-template-columns: 140px repeat(5, 1fr);
        grid-template-rows: 70px repeat(10, minmax(90px, 1fr));
    }
    
    .grid-header {
        font-size: 1.25rem;
        padding: 0.75rem;
    }
    
    .period-cell {
        padding: 0.75rem;
        min-height: 90px;
    }
    
    .subject {
        font-size: 1.125rem;
    }
    
    .class-room, .teacher {
        font-size: 1rem;
    }
    
    .announcement-text {
        font-size: 1.75rem;
    }
}

/* Extra large displays (1920px+) */
@media (min-width: 1920px) {
    .schedule-grid {
        grid-template-columns: 160px repeat(5, 1fr);
        grid-template-rows: 80px repeat(10, minmax(100px, 1fr));
    }
    
    .grid-header {
        font-size: 1.5rem;
        padding: 1rem;
    }
    
    .period-cell {
        padding: 1rem;
        min-height: 100px;
    }
    
    .subject {
        font-size: 1.25rem;
    }
    
    .class-room, .teacher {
        font-size: 1.125rem;
    }
    
    .announcement-text {
        font-size: 2rem;
    }
    
    .kiosk-header {
        height: 100px;
    }
    
    .kiosk-footer {
        height: 80px;
    }
}

/* Orientation-specific styles */
@media (orientation: portrait) and (max-width: 768px) {
    .schedule-grid {
        grid-template-columns: 60px repeat(2, 1fr);
    }
    
    /* Hide some days on small portrait screens */
    .schedule-grid .grid-header:nth-child(n+5),
    .schedule-grid .day-period:nth-child(n+5) {
        display: none;
    }
    
    .kiosk-main {
        padding: 0.5rem;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .kiosk-header {
        height: 50px;
    }
    
    .kiosk-footer {
        height: 50px; /* Increased from 40px */
        padding: 0.5rem 1rem; /* Increased padding */
    }
    
    .announcement-text {
        font-size: 1rem;
    }
    
    .footer-left, .footer-center, .footer-right {
        font-size: 0.75rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets for touch devices */
    .btn {
        min-height: 48px;
        padding: 0.875rem 1.75rem;
    }
    
    .period-cell {
        min-height: 48px;
    }
    
    .nav-item {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
    }
    
    /* Remove hover effects on touch devices */
    .period-cell:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Add active states for better touch feedback */
    .period-cell:active {
        background-color: #f3f4f6;
        transform: scale(0.98);
    }
    
    .btn:active {
        transform: scale(0.95);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .period-cell {
        border-width: 0.5px;
    }
    
    .schedule-grid {
        gap: 1px;
    }
}

/* Landscape phone specific adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .kiosk-header {
        height: 40px;
    }
    
    .kiosk-footer {
        height: 35px;
        padding: 0.25rem 1rem;
    }
    
    .announcement-text {
        font-size: 0.875rem;
    }
    
    .schedule-grid {
        grid-template-rows: 35px repeat(10, minmax(35px, 1fr));
    }
    
    .period-cell {
        padding: 0.25rem;
        min-height: 35px;
    }
    
    .subject {
        font-size: 0.625rem;
    }
    
    .class-room, .teacher {
        font-size: 0.5rem;
    }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
    .period-cell {
        border-width: 2px;
    }
    
    .period-cell.shift-1 {
        background-color: #bfdbfe;
        border-color: #1d4ed8;
    }
    
    .period-cell.shift-2 {
        background-color: #bbf7d0;
        border-color: #059669;
    }
    
    .subject {
        color: #000000;
        font-weight: 700;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .announcement-text {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    }
}

/* ===== ENHANCED ANIMATIONS AND TRANSITIONS ===== */

/* Content fade transitions */
.fade-transition {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

.fade-in-down {
    animation: fadeInDown 0.5s ease-out forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.5s ease-out forwards;
}

.fade-in-right {
    animation: fadeInRight 0.5s ease-out forwards;
}

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

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Enhanced current period highlighting */
.period-cell.current-period {
    background-color: #fef3c7;
    border: 2px solid #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
    animation: currentPeriodPulse 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.period-cell.current-period::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes currentPeriodPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px rgba(245, 158, 11, 0.6);
        transform: scale(1.01);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Period cell hover animations */
.period-cell {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.period-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.period-cell:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

/* Announcement ticker enhanced animations */
.announcement-ticker {
    transition: all 0.5s ease-in-out;
}

.announcement-ticker.changing {
    opacity: 0;
    transform: translateY(-10px);
}

.announcement-text {
    animation: scrollLeft 30s linear infinite;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.announcement-content.priority-high .announcement-text {
    animation: scrollLeft 30s linear infinite, priorityGlow 2s ease-in-out infinite;
}

.announcement-content.priority-urgent .announcement-text {
    animation: scrollLeft 30s linear infinite, urgentFlash 1.5s ease-in-out infinite;
}

@keyframes scrollLeft {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

@keyframes priorityGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.8);
    }
}

@keyframes urgentFlash {
    0%, 100% {
        background-color: #dc2626;
        box-shadow: 0 0 15px rgba(220, 38, 38, 0.6);
    }
    50% {
        background-color: #ef4444;
        box-shadow: 0 0 25px rgba(220, 38, 38, 0.9);
    }
}

/* Loading states and progress indicators */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(31, 41, 55, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: loadingBounce 0.5s ease-out;
}

@keyframes loadingBounce {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-dots {
    display: inline-flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.loading-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #3b82f6;
    animation: loadingDots 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 2px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Modal and overlay animations */
.admin-overlay {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.admin-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.admin-modal,
.admin-panel {
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.period-modal:not(.hidden) .modal-content,
.announcement-modal:not(.hidden) .modal-content {
    animation: modalBounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    50% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Button and interactive element animations */
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn > * {
    position: relative;
    z-index: 1;
}

/* Navigation and tab animations */
.nav-item {
    transition: all 0.2s ease;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #3b82f6;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.nav-item.active::before {
    transform: scaleY(1);
}

.shift-tab {
    transition: all 0.2s ease;
    position: relative;
}

.shift-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #3b82f6;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.shift-tab.active::after {
    transform: scaleX(1);
}

/* Clock and countdown animations */
.clock-display {
    transition: all 0.3s ease;
}

.time-display {
    transition: color 0.3s ease;
}

.countdown-timer {
    transition: all 0.3s ease;
}

.countdown-text {
    animation: countdownPulse 2s ease-in-out infinite;
}

@keyframes countdownPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Connection status animations */
.connection-status {
    transition: all 0.3s ease;
}

.status-indicator {
    transition: all 0.3s ease;
}

.status-indicator.online {
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Grid and table animations */
.schedule-grid {
    animation: gridFadeIn 0.8s ease-out;
}

@keyframes gridFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-header {
    animation: headerSlideDown 0.6s ease-out;
}

@keyframes headerSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animations for period cells */
.period-cell {
    animation: cellFadeIn 0.5s ease-out both;
}

.period-cell:nth-child(1) { animation-delay: 0.1s; }
.period-cell:nth-child(2) { animation-delay: 0.15s; }
.period-cell:nth-child(3) { animation-delay: 0.2s; }
.period-cell:nth-child(4) { animation-delay: 0.25s; }
.period-cell:nth-child(5) { animation-delay: 0.3s; }
.period-cell:nth-child(6) { animation-delay: 0.35s; }

@keyframes cellFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Notification animations */
.admin-notification {
    animation: notificationSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-notification.removing {
    animation: notificationSlideOut 0.3s ease-in forwards;
}

@keyframes notificationSlideIn {
    0% {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes notificationSlideOut {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}

/* Error message animations */
.error-message {
    animation: errorBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes errorBounce {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Form field animations */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Accessibility panel animations */
.accessibility-panel {
    animation: accessibilitySlideIn 0.4s ease-out;
}

.accessibility-controls {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top left;
}

.accessibility-controls:not(.hidden) {
    animation: dropdownExpand 0.3s ease-out;
}

@keyframes accessibilitySlideIn {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes dropdownExpand {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .announcement-text {
        animation: none;
        position: static;
        transform: none;
    }
    
    .period-cell.current-period {
        animation: none;
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
    }
    
    .period-cell.current-period::before {
        display: none;
    }
    
    .loading-spinner {
        animation: none;
        border-top-color: #3b82f6;
    }
    
    .loading-dot {
        animation: none;
        opacity: 1;
        transform: scale(1);
    }
    
    .progress-fill::after {
        display: none;
    }
    
    .countdown-text {
        animation: none;
    }
    
    .status-indicator.online {
        animation: none;
    }
    
    * {
        transition: none !important;
        animation: none !important;
    }
    
    .preview-text {
        animation: none;
    }
    
    /* Keep essential transitions for usability */
    .btn,
    .period-cell,
    .nav-item,
    .form-group input,
    .form-group select,
    .form-group textarea {
        transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
    }
}

/* Improved focus styles for keyboard navigation */
*:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

.period-cell:focus {
    outline: 3px solid #f59e0b;
    outline-offset: 1px;
    z-index: 10;
    position: relative;
}

.btn:focus {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 9999;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Improved touch targets for small screens */
@media (max-width: 480px) {
    .btn, .nav-item, .period-cell {
        min-height: 48px;
        min-width: 48px;
    }
    
    .close-btn {
        min-height: 48px;
        min-width: 48px;
        padding: 0.75rem;
    }
    
    .btn-icon {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem;
    }
}

/* Landscape orientation optimizations */
@media (orientation: landscape) and (max-height: 500px) {
    .kiosk-container {
        font-size: 14px;
    }
    
    .schedule-grid {
        grid-template-rows: 30px repeat(10, minmax(30px, 1fr));
    }
    
    .period-cell {
        min-height: 30px;
        padding: 0.125rem;
    }
    
    .subject {
        font-size: 0.625rem;
        margin-bottom: 0.125rem;
    }
    
    .class-room, .teacher {
        font-size: 0.5rem;
        line-height: 1;
    }
}

/* Ultra-wide display optimizations */
@media (min-width: 2560px) {
    .kiosk-container {
        max-width: 2400px;
        margin: 0 auto;
    }
    
    .schedule-grid {
        grid-template-columns: 200px repeat(5, 1fr);
        grid-template-rows: 100px repeat(10, minmax(120px, 1fr));
    }
    
    .grid-header {
        font-size: 1.75rem;
        padding: 1.25rem;
    }
    
    .period-cell {
        padding: 1.25rem;
        min-height: 120px;
    }
    
    .subject {
        font-size: 1.5rem;
    }
    
    .class-room, .teacher {
        font-size: 1.25rem;
    }
    
    .announcement-text {
        font-size: 2.5rem;
    }
    
    .kiosk-header {
        height: 120px;
    }
    
    .kiosk-footer {
        height: 100px;
    }
}

/* Print optimizations for documentation */
@media print {
    .kiosk-header,
    .kiosk-footer,
    .admin-overlay,
    .error-message,
    .loading-screen {
        display: none !important;
    }
    
    .kiosk-main {
        padding: 0;
    }
    
    .schedule-grid {
        background-color: white;
        border: 2px solid #000;
        page-break-inside: avoid;
    }
    
    .period-cell {
        border: 1px solid #000;
        background-color: white !important;
        break-inside: avoid;
    }
    
    .subject, .class-room, .teacher {
        color: #000 !important;
    }
    
    .grid-header {
        background-color: #f0f0f0 !important;
        color: #000 !important;
        border: 1px solid #000;
    }
    
    @page {
        margin: 1cm;
        size: A4 landscape;
    }
}

/* Dark mode responsive adjustments */
@media (prefers-color-scheme: dark) {
    @media (max-width: 768px) {
        .admin-sidebar {
            background-color: #111827;
        }
        
        .nav-item:hover {
            background-color: #374151;
        }
    }
    
    .period-cell:focus {
        outline-color: #fbbf24;
    }
    
    .btn:focus {
        outline-color: #60a5fa;
    }
}

/* Container queries for modern browsers */
@supports (container-type: inline-size) {
    .kiosk-main {
        container-type: inline-size;
    }
    
    @container (max-width: 600px) {
        .schedule-grid {
            grid-template-columns: 50px repeat(2, 1fr);
        }
    }
    
    @container (min-width: 1200px) {
        .schedule-grid {
            grid-template-columns: 140px repeat(5, 1fr);
        }
    }
}

/* Print styles (for documentation) */
@media print {
    .kiosk-header,
    .kiosk-footer,
    .admin-overlay,
    .error-message {
        display: none;
    }
    
    .kiosk-main {
        padding: 0;
    }
    
    .schedule-grid {
        background-color: white;
        border: 1px solid #000;
    }
    
    .period-cell {
        border: 1px solid #000;
        background-color: white !important;
    }
    
    .subject, .class-room, .teacher {
        color: #000 !important;
    }
}

/* Focus styles for keyboard navigation */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom scrollbar for admin interfaces */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== ADMIN MODE STYLES ===== */

/* Admin modal for PIN authentication */
.admin-modal {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
}

.admin-modal-header {
    background-color: #1f2937;
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

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

.admin-modal-body {
    padding: 2rem;
}

/* PIN dialog */
.pin-dialog {
    text-align: center;
}

.pin-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.pin-dialog h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.pin-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pin-input {
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    text-align: center;
    letter-spacing: 0.1em;
    transition: border-color 0.2s;
}

.pin-input:focus {
    border-color: #3b82f6;
    outline: none;
}

.pin-input.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.pin-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.pin-error {
    background-color: #fef2f2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #fecaca;
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Admin panel */
.admin-panel {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 95%;
    height: 90vh;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-header {
    background-color: #1f2937;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #374151;
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-user {
    font-size: 0.875rem;
    color: #d1d5db;
}

.admin-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.admin-sidebar {
    width: 250px;
    background-color: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 1rem 0;
}

.admin-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.875rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

.nav-item.active {
    background-color: #dbeafe;
    color: #1e40af;
    border-left-color: #3b82f6;
    font-weight: 500;
}

.admin-main {
    flex: 1;
    overflow: auto;
}

.admin-view-content {
    padding: 2rem;
    height: 100%;
}

/* Dashboard view */
.dashboard-view h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 2rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2rem;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.dashboard-actions,
.dashboard-info {
    margin-bottom: 2rem;
}

.dashboard-actions h3,
.dashboard-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.info-item strong {
    color: #374151;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

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

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

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

.btn-danger:hover {
    background-color: #b91c1c;
}

/* Forms */
.settings-form {
    max-width: 600px;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Placeholder messages */
.placeholder-message {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.placeholder-message p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Notifications */
.admin-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

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

.admin-notification.success {
    border-left: 4px solid #10b981;
    background-color: #f0fdf4;
}

.admin-notification.error {
    border-left: 4px solid #ef4444;
    background-color: #fef2f2;
}

.admin-notification.info {
    border-left: 4px solid #3b82f6;
    background-color: #eff6ff;
}

.notification-message {
    flex: 1;
    font-size: 0.875rem;
    color: #1f2937;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.notification-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ===== RESPONSIVE ADMIN INTERFACE ===== */

/* Mobile-first admin styles */
.admin-panel {
    width: 100%;
    height: 100vh;
    border-radius: 0;
}

.admin-modal {
    width: 95%;
    margin: 1rem;
    max-height: 90vh;
}

/* Touch-friendly admin elements */
.admin-nav .nav-item {
    min-height: 48px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
}

.admin-nav .nav-item:active {
    background-color: #e2e8f0;
    transform: scale(0.98);
}

.btn {
    min-height: 48px;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* Form elements for touch */
.form-group input,
.form-group select,
.form-group textarea {
    min-height: 48px;
    padding: 0.875rem;
    font-size: 1rem;
}

/* Mobile admin layout (320px - 767px) */
.admin-content {
    flex-direction: column;
}

.admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 0;
}

.admin-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 1rem;
    gap: 0.5rem;
}

.nav-item {
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    flex-shrink: 0;
}

.nav-item.active {
    border-left: none;
    border-bottom-color: #3b82f6;
}

.admin-view-content {
    padding: 1rem;
}

.dashboard-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.stat-card {
    padding: 1rem;
}

.stat-number {
    font-size: 1.5rem;
}

.action-buttons {
    flex-direction: column;
    gap: 0.75rem;
}

.form-actions {
    flex-direction: column;
    gap: 0.75rem;
}

.admin-notification {
    position: fixed;
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
}

/* Small mobile admin (480px+) */
@media (min-width: 480px) {
    .admin-modal {
        width: 90%;
        margin: 2rem auto;
    }
    
    .admin-view-content {
        padding: 1.5rem;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .form-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
}

/* Tablet admin (768px+) */
@media (min-width: 768px) {
    .admin-panel {
        width: 95%;
        height: 90vh;
        border-radius: 0.75rem;
        margin: 5vh auto;
    }
    
    .admin-modal {
        width: 80%;
        max-width: 600px;
    }
    
    .admin-content {
        flex-direction: row;
    }
    
    .admin-sidebar {
        width: 250px;
        border-right: 1px solid #e2e8f0;
        border-bottom: none;
        padding: 1rem 0;
    }
    
    .admin-nav {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }
    
    .nav-item {
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .nav-item.active {
        border-bottom: none;
        border-left-color: #3b82f6;
    }
    
    .admin-view-content {
        padding: 2rem;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .admin-notification {
        position: fixed;
        top: 2rem;
        right: 2rem;
        left: auto;
        bottom: auto;
        max-width: 400px;
    }
}

/* Desktop admin (1024px+) */
@media (min-width: 1024px) {
    .admin-panel {
        width: 90%;
        max-width: 1200px;
    }
    
    .admin-modal {
        width: 70%;
        max-width: 500px;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large desktop admin (1440px+) */
@media (min-width: 1440px) {
    .admin-panel {
        width: 85%;
        max-width: 1400px;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Admin interface for touch devices */
@media (hover: none) and (pointer: coarse) {
    .nav-item:hover {
        background-color: transparent;
    }
    
    .nav-item:active {
        background-color: #e2e8f0;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.95);
    }
    
    .stat-card:hover {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .period-cell:hover {
        background-color: white;
        box-shadow: none;
    }
}

/* Responsive schedule editor */
@media (max-width: 767px) {
    .schedule-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .schedule-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .shift-tabs {
        overflow-x: auto;
    }
    
    .shift-tab {
        flex-shrink: 0;
        min-width: 120px;
    }
    
    .editor-grid {
        grid-template-columns: 60px repeat(2, 1fr);
        min-width: 300px;
    }
    
    .grid-cell {
        padding: 0.25rem;
        min-height: 50px;
        font-size: 0.75rem;
    }
    
    .period-content .subject {
        font-size: 0.625rem;
    }
    
    .period-content .class-room,
    .period-content .teacher {
        font-size: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .period-form .form-actions {
        flex-direction: column;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .editor-grid {
        grid-template-columns: 80px repeat(3, 1fr);
        min-width: 600px;
    }
    
    .grid-cell {
        padding: 0.5rem;
        min-height: 60px;
    }
}

@media (min-width: 1024px) {
    .editor-grid {
        grid-template-columns: 100px repeat(5, 1fr);
        min-width: 800px;
    }
    
    .grid-cell {
        padding: 0.75rem;
        min-height: 80px;
    }
}

/* Responsive announcements management */
@media (max-width: 767px) {
    .announcements-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .announcements-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .announcements-stats {
        grid-template-columns: 1fr;
    }
    
    .list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .list-filters {
        justify-content: stretch;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .announcements-table-content {
        font-size: 0.75rem;
    }
    
    .announcements-table-content th,
    .announcements-table-content td {
        padding: 0.375rem;
    }
    
    .text-cell {
        max-width: 120px;
    }
    
    /* Hide less important columns on mobile */
    .announcements-table-content th:nth-child(4),
    .announcements-table-content td:nth-child(4),
    .announcements-table-content th:nth-child(5),
    .announcements-table-content td:nth-child(5) {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .color-presets {
        flex-wrap: wrap;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .announcements-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .text-cell {
        max-width: 200px;
    }
}

@media (min-width: 1024px) {
    .announcements-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .text-cell {
        max-width: 300px;
    }
}

/* Responsive bell controller */
@media (max-width: 767px) {
    .bell-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .bell-actions .btn {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .status-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .connection-indicator {
        justify-content: center;
    }
}

@media (min-width: 768px) {
    .bell-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .bell-actions .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Responsive cache management */
@media (max-width: 767px) {
    .cache-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .cache-details-grid {
        grid-template-columns: 1fr;
    }
    
    .limits-grid {
        grid-template-columns: 1fr;
    }
    
    .cache-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .cache-actions .btn {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .cache-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .cache-details-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .limits-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .cache-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Dark mode support for admin interface */
@media (prefers-color-scheme: dark) {
    .admin-modal,
    .admin-panel {
        background-color: #1f2937;
        color: white;
    }
    
    .admin-modal-body {
        background-color: #1f2937;
    }
    
    .pin-dialog h3 {
        color: white;
    }
    
    .pin-input {
        background-color: #374151;
        border-color: #4b5563;
        color: white;
    }
    
    .pin-input:focus {
        border-color: #60a5fa;
    }
    
    .admin-sidebar {
        background-color: #111827;
        border-color: #374151;
    }
    
    .nav-item {
        color: #9ca3af;
    }
    
    .nav-item:hover {
        background-color: #374151;
        color: #f3f4f6;
    }
    
    .nav-item.active {
        background-color: #1e3a8a;
        color: #dbeafe;
    }
    
    .stat-card {
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .stat-number {
        color: white;
    }
    
    .form-section {
        border-color: #4b5563;
    }
    
    .form-group input,
    .form-group select {
        background-color: #374151;
        border-color: #4b5563;
        color: white;
    }
    
    .info-item {
        background-color: #374151;
        border-color: #4b5563;
    }
}
/* ===== SCHEDULE EDITOR STYLES ===== */

/* Schedule view */
.schedule-view {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.schedule-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.schedule-actions {
    display: flex;
    gap: 0.75rem;
}

/* Schedule editor */
.schedule-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.shift-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.shift-tab {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.shift-tab:hover {
    color: #374151;
    background-color: #f9fafb;
}

.shift-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 500;
}

/* Schedule grid editor */
.schedule-grid-editor {
    flex: 1;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.editor-grid {
    display: grid;
    grid-template-columns: 120px repeat(5, 1fr);
    min-width: 800px;
}

.grid-cell {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.grid-cell.header {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
    text-align: center;
    min-height: 60px;
}

.grid-cell.time-header {
    background-color: #1f2937;
    color: white;
}

.grid-cell.day-header {
    background-color: #374151;
    color: white;
    text-transform: capitalize;
}

.time-cell {
    background-color: #f9fafb;
    text-align: center;
}

.period-number {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.time-slot {
    font-size: 0.75rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    margin: 1px 0;
}

.time-slot.shift-1 {
    background-color: #dbeafe;
    color: #1e40af;
}

.time-slot.shift-2 {
    background-color: #dcfce7;
    color: #166534;
}

.period-cell {
    background-color: white;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.period-cell:hover {
    background-color: #f9fafb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.period-cell.has-data {
    background-color: #f0f9ff;
}

.period-cell.has-data:hover {
    background-color: #e0f2fe;
}

.period-cell.empty {
    background-color: #fafafa;
    border-style: dashed;
}

.period-cell.empty:hover {
    background-color: #f0f0f0;
}

.period-content {
    width: 100%;
}

.period-content.shift-I {
    border-left: 3px solid #3b82f6;
    padding-left: 0.5rem;
}

.period-content.shift-II {
    border-left: 3px solid #10b981;
    padding-left: 0.5rem;
}

.period-content .subject {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.period-content .class-room {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.125rem;
}

.period-content .teacher {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
}

.empty-period {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    font-size: 0.875rem;
}

/* Period edit modal */
.period-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.period-modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    background-color: #f8fafc;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.modal-body {
    padding: 2rem;
}

.period-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.period-form .form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.period-form .form-group input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.period-form .form-group input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.period-form .form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

/* Responsive schedule editor */
@media (max-width: 1024px) {
    .schedule-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .editor-grid {
        grid-template-columns: 100px repeat(5, 1fr);
        min-width: 700px;
    }
    
    .grid-cell {
        padding: 0.5rem;
        min-height: 70px;
    }
    
    .period-content .subject {
        font-size: 0.75rem;
    }
    
    .period-content .class-room,
    .period-content .teacher {
        font-size: 0.625rem;
    }
}

@media (max-width: 768px) {
    .schedule-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .schedule-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .shift-tabs {
        flex-direction: column;
    }
    
    .shift-tab {
        text-align: left;
        border-bottom: none;
        border-right: 2px solid transparent;
    }
    
    .shift-tab.active {
        border-bottom: none;
        border-right-color: #3b82f6;
    }
    
    .editor-grid {
        grid-template-columns: 80px repeat(3, 1fr);
        min-width: 400px;
    }
    
    .grid-cell {
        padding: 0.25rem;
        min-height: 60px;
        font-size: 0.75rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .period-form .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .editor-grid {
        grid-template-columns: 60px repeat(2, 1fr);
        min-width: 300px;
    }
    
    .grid-cell {
        padding: 0.125rem;
        min-height: 50px;
        font-size: 0.625rem;
    }
    
    .period-content .subject {
        font-size: 0.625rem;
    }
    
    .period-content .class-room,
    .period-content .teacher {
        font-size: 0.5rem;
    }
}

/* Dark mode support for schedule editor */
@media (prefers-color-scheme: dark) {
    .schedule-header {
        border-color: #4b5563;
    }
    
    .shift-tabs {
        border-color: #4b5563;
    }
    
    .shift-tab:hover {
        background-color: #374151;
        color: #f3f4f6;
    }
    
    .schedule-grid-editor {
        border-color: #4b5563;
    }
    
    .grid-cell {
        border-color: #4b5563;
    }
    
    .grid-cell.header {
        background-color: #374151;
        color: #f3f4f6;
    }
    
    .time-cell {
        background-color: #111827;
    }
    
    .period-cell {
        background-color: #1f2937;
    }
    
    .period-cell:hover {
        background-color: #374151;
    }
    
    .period-cell.has-data {
        background-color: #1e3a8a;
    }
    
    .period-cell.empty {
        background-color: #111827;
    }
    
    .modal-content {
        background-color: #1f2937;
        color: white;
    }
    
    .modal-header {
        background-color: #111827;
        border-color: #4b5563;
    }
    
    .period-form .form-group input {
        background-color: #374151;
        border-color: #4b5563;
        color: white;
    }
}
/* ===== ANNOUNCEMENT MANAGEMENT STYLES ===== */

/* Announcements view */
.announcements-view {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.announcements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.announcements-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.announcements-actions {
    display: flex;
    gap: 0.75rem;
}

.announcements-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Announcements list */
.announcements-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.list-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.list-filters {
    display: flex;
    gap: 0.75rem;
}

.list-filters select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
}

/* Announcements table */
.announcements-table {
    flex: 1;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: white;
}

.announcements-table-content {
    width: 100%;
    border-collapse: collapse;
}

.announcements-table-content th {
    background-color: #f8fafc;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.announcements-table-content td {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.announcement-row:hover {
    background-color: #f9fafb;
}

.announcement-row.expired {
    opacity: 0.6;
}

/* Table cells */
.text-cell {
    max-width: 300px;
}

.announcement-text-preview {
    font-weight: 500;
    line-height: 1.4;
}

.priority-cell {
    text-align: center;
}

.priority-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.priority-badge.priority-normal {
    background-color: #f3f4f6;
    color: #374151;
}

.priority-badge.priority-high {
    background-color: #fef3c7;
    color: #92400e;
}

.priority-badge.priority-urgent {
    background-color: #fecaca;
    color: #991b1b;
}

.color-cell {
    text-align: center;
}

.color-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    margin: 0 auto;
}

.date-cell,
.expires-cell {
    font-size: 0.875rem;
    color: #6b7280;
    white-space: nowrap;
}

.status-cell {
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.expired {
    background-color: #fee2e2;
    color: #991b1b;
}

.actions-cell {
    text-align: center;
    white-space: nowrap;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.25rem;
    margin: 0 0.125rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: #f3f4f6;
}

.btn-icon.btn-danger:hover {
    background-color: #fef2f2;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Announcement edit modal */
.announcement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-modal.hidden {
    display: none;
}

.announcement-modal .modal-content {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
}

.announcement-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.announcement-form .form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.announcement-form .form-group input,
.announcement-form .form-group select,
.announcement-form .form-group textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.announcement-form .form-group input:focus,
.announcement-form .form-group select:focus,
.announcement-form .form-group textarea:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.char-counter {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: right;
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.color-picker-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-presets {
    display: flex;
    gap: 0.5rem;
}

.color-preset {
    width: 32px;
    height: 32px;
    border: 2px solid #e5e7eb;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.color-preset:hover {
    border-color: #3b82f6;
    transform: scale(1.1);
}

.form-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Announcement preview */
.announcement-preview {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    background-color: #f9fafb;
}

.announcement-preview h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.preview-content {
    background-color: #1f2937;
    border-radius: 0.375rem;
    overflow: hidden;
    height: 60px;
}

.preview-ticker {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.preview-text {
    padding: 0 1rem;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    animation: scroll-preview 10s linear infinite;
}

@keyframes scroll-preview {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Responsive announcements */
@media (max-width: 1024px) {
    .announcements-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .announcements-stats {
        grid-template-columns: 1fr;
    }
    
    .list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .list-filters {
        justify-content: center;
    }
    
    .announcements-table-content th,
    .announcements-table-content td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .text-cell {
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .announcements-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .announcements-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .announcement-modal .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .announcements-table-content {
        font-size: 0.75rem;
    }
    
    .announcements-table-content th,
    .announcements-table-content td {
        padding: 0.375rem;
    }
    
    .text-cell {
        max-width: 150px;
    }
    
    .date-cell,
    .expires-cell {
        display: none;
    }
}

@media (max-width: 480px) {
    .announcements-table-content th:nth-child(3),
    .announcements-table-content td:nth-child(3),
    .announcements-table-content th:nth-child(4),
    .announcements-table-content td:nth-child(4),
    .announcements-table-content th:nth-child(5),
    .announcements-table-content td:nth-child(5) {
        display: none;
    }
    
    .text-cell {
        max-width: 120px;
    }
    
    .color-presets {
        flex-wrap: wrap;
    }
}

/* Dark mode support for announcements */
@media (prefers-color-scheme: dark) {
    .announcements-header {
        border-color: #4b5563;
    }
    
    .list-filters select {
        background-color: #374151;
        border-color: #4b5563;
        color: white;
    }
    
    .announcements-table {
        border-color: #4b5563;
        background-color: #1f2937;
    }
    
    .announcements-table-content th {
        background-color: #111827;
        color: #f3f4f6;
        border-color: #4b5563;
    }
    
    .announcements-table-content td {
        border-color: #374151;
    }
    
    .announcement-row:hover {
        background-color: #374151;
    }
    
    .announcement-modal .modal-content {
        background-color: #1f2937;
        color: white;
    }
    
    .announcement-form .form-group input,
    .announcement-form .form-group select,
    .announcement-form .form-group textarea {
        background-color: #374151;
        border-color: #4b5563;
        color: white;
    }
    
    .announcement-preview {
        background-color: #111827;
        border-color: #4b5563;
    }
    
    .color-preset {
        border-color: #4b5563;
    }
}

/* Bell Controller Styles */
.bell-status-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.status-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.connection-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.connection-indicator.connected {
    background-color: #d1fae5;
    color: #065f46;
}

.connection-indicator.disconnected {
    background-color: #fee2e2;
    color: #991b1b;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulse 2s infinite;
}

.connection-indicator.connected .indicator-dot {
    background-color: #10b981;
}

.connection-indicator.disconnected .indicator-dot {
    background-color: #ef4444;
}

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

.bell-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.bell-actions .btn {
    flex: 1;
    min-width: 120px;
}

.bell-statistics {
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}

.bell-statistics h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

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

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.bell-unavailable {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.bell-unavailable p {
    color: #92400e;
    font-size: 0.875rem;
    margin: 0;
}

/* Connection status in footer */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online {
    background-color: #10b981;
    animation: pulse 2s infinite;
}

.status-indicator.offline {
    background-color: #ef4444;
}

.status-text {
    color: #6b7280;
    font-weight: 500;
}

/* Responsive bell controller */
@media (max-width: 768px) {
    .bell-actions {
        flex-direction: column;
    }
    
    .bell-actions .btn {
        flex: none;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .status-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .connection-indicator {
        justify-content: center;
    }
}

/* Dark mode support for bell controller */
@media (prefers-color-scheme: dark) {
    .bell-status-card {
        background-color: #1f2937;
        border-color: #4b5563;
    }
    
    .status-header h4,
    .bell-statistics h4 {
        color: #f3f4f6;
    }
    
    .stat-item {
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .stat-label {
        color: #9ca3af;
    }
    
    .stat-value {
        color: #f3f4f6;
    }
    
    .bell-unavailable {
        background-color: #451a03;
        border-color: #92400e;
    }
    
    .bell-unavailable p {
        color: #fbbf24;
    }
    
    .status-text {
        color: #9ca3af;
    }
}

/* Cache Management Styles */
.cache-management-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.cache-stats-container {
    margin-bottom: 1rem;
}

.cache-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cache-stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cache-stat-card .stat-icon {
    font-size: 1.5rem;
}

.cache-stat-card .stat-content {
    flex: 1;
}

.cache-stat-card .stat-number {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.cache-stat-card .stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.cache-breakdown {
    margin-bottom: 1.5rem;
}

.cache-breakdown h4 {
    margin: 0 0 0.75rem 0;
    color: #374151;
    font-size: 1rem;
}

.cache-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.cache-detail-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.75rem;
    text-align: center;
}

.cache-detail-item .cache-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.cache-detail-item .cache-size {
    color: #3b82f6;
    font-weight: 500;
    font-size: 0.875rem;
}

.cache-detail-item .cache-entries {
    color: #6b7280;
    font-size: 0.75rem;
}

.cache-limits {
    margin-bottom: 1rem;
}

.cache-limits h4 {
    margin: 0 0 0.75rem 0;
    color: #374151;
    font-size: 1rem;
}

.limits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.limit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.limit-item .limit-label {
    color: #6b7280;
}

.limit-item .limit-value {
    color: #1f2937;
    font-weight: 500;
}

.cache-last-cleanup {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.25rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: #0c4a6e;
    margin-top: 1rem;
}

.cache-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cache-actions .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.cache-unavailable {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 0.375rem;
    padding: 1rem;
    color: #92400e;
}

.cache-unavailable p {
    margin: 0;
    font-size: 0.875rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-style: italic;
}

.error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 0.375rem;
    padding: 1rem;
    color: #dc2626;
    font-size: 0.875rem;
}

/* Cache Management UI Component Styles */
.cache-management-ui {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1rem 0;
}

.cache-stats-panel h3 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-size: 1.125rem;
}

.cache-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.cache-stat-item .label {
    color: #6b7280;
    font-size: 0.875rem;
}

.cache-stat-item .value {
    color: #1f2937;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cache-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .cache-details-grid {
        grid-template-columns: 1fr;
    }
    
    .limits-grid {
        grid-template-columns: 1fr;
    }
    
    .cache-actions {
        flex-direction: column;
    }
    
    .cache-actions .btn {
        width: 100%;
    }
}

/* Enhanced Export/Import/Backup Modal Styles */
.export-modal,
.import-modal,
.backup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.export-modal .modal-content,
.import-modal .modal-content,
.backup-modal .modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.export-modal .modal-header,
.import-modal .modal-header,
.backup-modal .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9fafb;
    border-radius: 12px 12px 0 0;
}

.export-modal .modal-header h3,
.import-modal .modal-header h3,
.backup-modal .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.export-modal .modal-body,
.import-modal .modal-body,
.backup-modal .modal-body {
    padding: 1.5rem;
}

/* Form sections */
.form-section {
    margin-bottom: 1.5rem;
}

.form-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

/* Radio and checkbox groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option:hover,
.checkbox-option:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.radio-label,
.checkbox-label {
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}

.radio-option small,
.checkbox-option small {
    display: block;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Import tabs */
.import-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #374151;
    background-color: #f9fafb;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.import-tab {
    display: none;
}

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

/* Backup list styles */
.backup-list-container {
    max-height: 400px;
    overflow-y: auto;
}

.backup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.backup-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.backup-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
}

.backup-info {
    flex: 1;
}

.backup-date {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.backup-details {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.backup-size {
    font-weight: 500;
}

.backup-desc {
    font-style: italic;
}

.backup-actions {
    display: flex;
    gap: 0.5rem;
}

/* Backup management styles */
.backup-actions-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.backup-stats {
    font-size: 0.875rem;
    color: #6b7280;
}

.backup-table {
    overflow-x: auto;
}

.backup-table table {
    width: 100%;
    border-collapse: collapse;
}

.backup-table th,
.backup-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.backup-table th {
    font-weight: 600;
    color: #374151;
    background-color: #f9fafb;
}

.backup-table td {
    color: #6b7280;
}

/* Button styles for modals */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Loading and empty states */
.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 2rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Error states */
.error {
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.875rem;
}

/* Form help text */
.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Responsive adjustments for modals */
@media (max-width: 768px) {
    .export-modal .modal-content,
    .import-modal .modal-content,
    .backup-modal .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .backup-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .backup-actions {
        align-self: stretch;
        justify-content: flex-end;
    }
    
    .import-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .tab-btn.active {
        border-left-color: #3b82f6;
        border-bottom-color: transparent;
    }
}

/* Animation for modal appearance */
.export-modal,
.import-modal,
.backup-modal {
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.export-modal .modal-content,
.import-modal .modal-content,
.backup-modal .modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

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