/* =================== LOADING SCREEN STYLES =================== */
    .loading-screen {
        position: fixed;
        top: 60px; /* Start below header */
        left: 0;
        width: 100%;
        height: calc(100vh - 60px); /* Full viewport minus header */
        background: #f8f9fa;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        transition: opacity 0.5s ease-out;
    }

    /* Header hidden state support */
    .loading-screen.header-hidden {
        top: 0;
        height: 100vh;
    }

    /* Responsive loading screen adjustments */
    @media (max-width: 768px) {
        .loading-screen {
            top: 60px; /* Maintain header space on mobile */
            height: calc(100vh - 60px);
            padding: 10px; /* Add padding for mobile */
        }
        
        .loading-screen.header-hidden {
            top: 0;
            height: 100vh;
            padding: 20px 10px;
        }
    }

    @media (max-width: 480px) {
        .loading-screen {
            padding: 5px;
        }
        
        .loading-screen.header-hidden {
            padding: 10px 5px;
        }
    }
    
    .loading-screen.fade-out {
        opacity: 0;
        pointer-events: none;
    }
    
    .loading-content {
        text-align: center;
        color: #333;
        max-width: 400px; /* Reduced from 500px */
        width: 85%; /* Slightly smaller width */
        max-height: calc(100vh - 140px); /* More conservative height */
        padding: 25px 20px; /* Reduced padding */
        background: white;
        border-radius: 10px; /* Slightly less rounded */
        border: 1px solid #e9ecef;
        box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1); /* Smaller shadow */
        overflow-y: auto;
    }

    /* Responsive loading content */
    @media (max-width: 1024px) and (min-width: 769px) {
        /* Small tablets */
        .loading-content {
            max-width: 350px;
            width: 80%;
            padding: 20px 15px;
            max-height: calc(100vh - 120px);
        }
    }

    @media (max-width: 768px) {
        .loading-content {
            max-width: 320px; /* Smaller on tablets */
            width: 90%;
            padding: 18px 15px; /* Reduced padding */
            max-height: calc(100vh - 100px);
        }
    }

    @media (max-width: 480px) {
        .loading-content {
            max-width: 300px; /* Even smaller on mobile */
            width: 95%;
            padding: 15px 12px; /* More compact */
            max-height: calc(100vh - 80px);
            border-radius: 8px;
        }
    }
    
    .loading-logo {
        margin-bottom: 20px; /* Reduced from 35px */
    }
    
    .loading-logo-img {
        width: 80px; /* Reduced from 120px */
        height: 80px;
        opacity: 0.9;
    }
    
    .loading-title h2 {
        margin: 0 0 8px 0; /* Reduced margin */
        font-size: 22px; /* Reduced from 26px */
        font-weight: 600;
        color: #2c3e50;
        letter-spacing: -0.5px;
    }
    
    .loading-title p {
        margin: 0 0 20px 0; /* Reduced from 35px */
        font-size: 14px; /* Reduced from 15px */
        color: #6c757d;
        font-weight: 400;
    }
    
    .loading-progress {
        margin-bottom: 20px; /* Reduced from 35px */
    }
    
    .progress-bar {
        width: 100%;
        height: 5px; /* Slightly smaller */
        background: #e9ecef;
        border-radius: 3px;
        overflow: hidden;
        margin-bottom: 8px; /* Reduced from 12px */
    }
    
    .progress-fill {
        height: 100%;
        background: #007bff;
        border-radius: 3px;
        width: 0%;
        transition: width 0.4s ease;
    }
    
    .progress-percentage {
        font-size: 12px; /* Reduced from 13px */
        font-weight: 600;
        color: #495057;
        letter-spacing: 0.5px;
    }
    
    .loading-steps {
        text-align: left;
        margin-bottom: 20px; /* Reduced from 30px */
    }
    
    .step {
        display: flex;
        align-items: center;
        padding: 6px 0; /* Reduced from 10px */
        font-size: 13px; /* Reduced from 14px */
        color: #6c757d;
        transition: all 0.3s ease;
        border-radius: 4px; /* Smaller radius */
        margin-bottom: 1px; /* Reduced spacing */
    }
    
    .step.active {
        color: #007bff;
        font-weight: 500;
        background: #f8f9fa;
        padding-left: 6px; /* Reduced padding */
        padding-right: 6px;
    }
    
    .step.completed {
        color: #28a745;
        font-weight: 400;
    }
    
    .step-icon {
        width: 24px; /* Reduced from 30px */
        font-size: 14px; /* Reduced from 16px */
        margin-right: 10px; /* Reduced from 15px */
        text-align: center;
    }
    
    .step-text {
        flex: 1;
    }
    
    .step-status {
        font-size: 13px; /* Reduced from 14px */
        min-width: 22px; /* Reduced from 25px */
        text-align: center;
    }
    
    .loading-spinner {
        margin-top: 15px; /* Reduced from 20px */
    }
    
    .spinner {
        width: 28px; /* Reduced from 32px */
        height: 28px;
        border: 2px solid #e9ecef;
        border-top: 2px solid #007bff;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    /* Small tablets - Ensure all content is visible */
    @media (max-width: 1024px) and (min-width: 769px) {
        .loading-title h2 {
            font-size: 20px;
            margin-bottom: 6px;
        }
        
        .loading-title p {
            font-size: 13px;
            margin-bottom: 15px;
        }
        
        .loading-logo {
            margin-bottom: 15px;
        }
        
        .loading-logo-img {
            width: 70px;
            height: 70px;
        }
        
        .loading-progress {
            margin-bottom: 15px;
        }
        
        .step {
            font-size: 12px;
            padding: 4px 0;
        }
        
        .step-icon {
            width: 20px;
            font-size: 12px;
            margin-right: 8px;
        }
        
        .loading-steps {
            margin-bottom: 15px;
        }
        
        .loading-spinner {
            margin-top: 10px;
        }
        
        .spinner {
            width: 24px;
            height: 24px;
        }
    }

    /* Mobile responsiveness for loading screen */
    @media (max-width: 768px) {
        .loading-title h2 {
            font-size: 19px; /* Reduced */
            margin-bottom: 6px;
        }
        
        .loading-title p {
            font-size: 13px;
            margin-bottom: 15px; /* Reduced */
        }
        
        .loading-logo {
            margin-bottom: 15px; /* Reduced */
        }
        
        .loading-logo-img {
            width: 70px; /* Reduced */
            height: 70px;
        }
        
        .loading-progress {
            margin-bottom: 15px; /* Reduced */
        }
        
        .step {
            font-size: 12px; /* Reduced */
            padding: 4px 0; /* Reduced */
        }
        
        .step-icon {
            width: 20px; /* Reduced */
            font-size: 12px;
            margin-right: 8px; /* Reduced */
        }
        
        .loading-steps {
            margin-bottom: 15px; /* Reduced */
        }
        
        .loading-spinner {
            margin-top: 10px;
        }
        
        .spinner {
            width: 24px;
            height: 24px;
        }
    }
    
    @media (max-width: 480px) {
        .loading-title h2 {
            font-size: 18px; /* Further reduced */
            margin-bottom: 4px;
        }
        
        .loading-title p {
            font-size: 12px; /* Reduced */
            margin-bottom: 12px; /* Reduced */
        }
        
        .loading-logo {
            margin-bottom: 12px; /* Reduced */
        }
        
        .loading-logo-img {
            width: 60px; /* Further reduced */
            height: 60px;
        }
        
        .loading-progress {
            margin-bottom: 12px; /* Reduced */
        }
        
        .progress-percentage {
            font-size: 11px; /* Reduced */
        }
        
        .step {
            font-size: 11px; /* Further reduced */
            padding: 3px 0; /* Reduced */
            margin-bottom: 0; /* No margin */
        }
        
        .step-icon {
            width: 18px; /* Reduced */
            font-size: 11px; /* Reduced */
            margin-right: 6px; /* Reduced */
        }
        
        .loading-steps {
            margin-bottom: 12px; /* Reduced */
        }
        
        .loading-spinner {
            margin-top: 8px; /* Reduced */
        }
        
        .spinner {
            width: 22px; /* Reduced */
            height: 22px;
        }
    }

    /* =================== RESPONSIVE RESET =================== */
    * {
        box-sizing: border-box;
    }
    
    .facial-recognition-container {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: auto;
        padding: 12px;
        background: #f8f9fa;
        transition: top 0.3s ease;
    }

    /* =================== RESPONSIVE LAYOUT SYSTEM =================== */
    .main-grid {
        display: grid;
        height: calc(100vh - 60px); /* Use height instead of min-height */
        max-height: calc(100vh - 60px); /* Enforce viewport constraint */
        gap: 12px;
        grid-template-rows: 1fr; /* Single row now since header content is moved */
        transition: height 0.3s ease;
        overflow: hidden; /* Prevent main grid from creating scrollbar */
    }

    /* When header is hidden, use full viewport */
    .main-grid.header-hidden {
        height: 100vh;
        max-height: 100vh;
    }

    /* Content area (now the main area) */
    .content-section {
        display: grid;
        gap: 12px;
        min-height: 0;
        overflow: hidden; /* Let individual sections handle their own scrolling */
    }

    /* Responsive grid templates */
    @media (min-width: 768px) {
        .content-section {
            grid-template-columns: 0.9fr 1.1fr;
            grid-template-rows: 1fr;
        }
    }

    @media (max-width: 767px) {
        .content-section {
            grid-template-columns: 1fr;
            grid-template-rows: auto 1fr;
        }
        
        .facial-recognition-container {
            padding: 8px;
        }
        
        .main-grid {
            gap: 8px;
            height: calc(100vh - 60px); /* Maintain viewport constraint */
            max-height: calc(100vh - 60px);
        }
        
        .content-section {
            gap: 8px;
            overflow-y: auto; /* Allow scrolling within content on mobile if needed */
        }
        
        .sidebar {
            gap: 6px; /* Reduced gap between bulletin and attendance */
        }
    }

    /* =================== CARD SYSTEM =================== */
    .card {
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        min-height: 0;
        border: 1px solid #e9ecef;
    }

    .card-body {
        padding: 16px;
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    /* Responsive card padding */
    @media (max-width: 767px) {
        .card {
            border-radius: 8px;
        }
        
        .card-body {
            padding: 12px;
        }
    }

    @media (max-width: 480px) {
        .card {
            border-radius: 6px;
        }
        
        .card-body {
            padding: 10px;
        }
    }


    /* =================== LEFT SIDEBAR =================== */
    .sidebar {
        display: grid;
        gap: 12px;
        min-height: 0;
    }

    @media (min-width: 768px) {
        .sidebar {
            grid-template-rows: 1fr 1fr; /* Equal halves - 50/50 split */
        }
    }

    @media (max-width: 1024px) and (min-width: 768px) {
        /* Small tablets - reduce gap further */
        .sidebar {
            gap: 8px; /* Reduced from 12px */
        }
    }

    @media (max-width: 767px) {
        .sidebar {
            grid-template-rows: 200px auto; /* Fixed height for bulletin on mobile */
            gap: 6px; /* Further reduced for mobile */
        }
    }

    .bulletin-card {
        min-height: 200px; /* Standard minimum height */
        display: flex;
        flex-direction: column;
    }

    .bulletin-card .card-body {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

    .bulletin-content {
        flex: 1;
        overflow-y: auto;
        padding-top: 12px;
        min-height: 150px; /* Ensure space for announcements */
    }

    .attendance-card {
        flex: 1;
        min-height: 200px;
        display: flex;
        flex-direction: column;
    }

    .attendance-logs-container {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    /* Mobile sidebar adjustments */
    @media (max-width: 767px) {
        .bulletin-card {
            min-height: 180px; /* Maintain decent size on mobile */
        }
        
        .bulletin-content {
            min-height: 120px;
        }
        
        .attendance-card {
            min-height: 150px;
        }
        
        .attendance-logs-container {
            max-height: 120px;
        }
    }

    @media (max-width: 480px) {
        .bulletin-card {
            min-height: 160px; /* Still reasonable on small mobile */
        }
        
        .bulletin-content {
            min-height: 100px;
        }
        
        .attendance-card {
            min-height: 120px;
        }
        
        .attendance-logs-container {
            max-height: 100px;
        }
    }

    /* =================== ANIMATIONS =================== */
    @keyframes gentle-pulse {
        0% { box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3); }
        50% { box-shadow: 0 6px 12px rgba(243, 156, 18, 0.5); }
        100% { box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3); }
    }

    /* =================== VIDEO SECTION =================== */
    .video-section {
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%; /* Match the height of attendance card */
    }

    .video-container {
        position: relative;
        flex: 1;
        min-height: 180px;
        height: calc(100% - 72px);
        background: white;
        border-radius: 12px; /* Match button radius */
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 12px;
        border: 2px solid #e5e7eb; /* Subtle border */
        box-shadow: 0 4px 12px rgba(0,0,0,0.1); /* Match button shadow */
    }

    #video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
    }

    /* Responsive video sizing - Aligned with attendance card */
    @media (min-width: 768px) {
        /* Video section will match attendance card height automatically */
        .video-section {
            /* Remove max-height to allow full alignment */
        }
    }

    @media (min-width: 1400px) {
        .video-container {
            /* Allow natural aspect ratio within calculated height */
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }
        
        #video {
            object-fit: cover;
        }
    }

    /* Mobile video sizing - Maintain alignment */
    @media (max-width: 767px) {
        .video-container {
            min-height: 140px; /* Reduced but still functional */
            /* Keep calculated height for alignment */
        }
        
        .button-container {
            height: 50px; /* Smaller buttons on mobile */
        }
        
        .video-container {
            height: calc(100% - 62px); /* Adjust for smaller button height */
        }
    }

    @media (max-width: 480px) {
        .video-container {
            min-height: 120px; /* Compact but usable */
        }
        
        .button-container {
            height: 48px; /* Even smaller on tiny screens */
        }
        
        .video-container {
            height: calc(100% - 60px); /* Adjust for button height */
            margin-bottom: 12px;
        }
    }

    #overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 1;
    }

    #detectionCanvas {
        display: none;
    }

    /* =================== CLEAN VIDEO BORDER SYSTEM =================== */
    .video-border {
        position: relative;
        border-radius: 12px; /* Match container radius */
        border: 2px solid transparent; /* Default transparent border */
        transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
        height: 100%;
        background: white;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .video-border.flash-red {
        border-color: #ef4444; /* Match button red */
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.4), inset 0 0 20px rgba(239, 68, 68, 0.1);
        background: linear-gradient(145deg, #ffffff, #fef2f2);
    }

    .video-border.flash-green {
        border-color: #10b981; /* Match button green */
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.4), inset 0 0 20px rgba(16, 185, 129, 0.1);
        background: linear-gradient(145deg, #ffffff, #f0fdfa);
    }

    .video-border .video-container {
        position: relative;
        margin: 0;
        border-radius: 10px; /* Slightly less than parent */
        overflow: hidden;
        width: 100%;
        height: 100%;
        border: none; /* Remove border since parent has it */
        box-shadow: none; /* Remove shadow since parent handles it */
    }

    /* Large screen video border adjustments */
    @media (min-width: 1400px) {
        .video-border {
            max-height: 500px;
            aspect-ratio: 16/9;
        }
    }

    @media (min-width: 1600px) {
        .video-border {
            max-height: 550px;
            max-width: 800px;
            margin: 0 auto;
        }
    }

    /* =================== ENHANCED BUTTON SYSTEM =================== */
    .button-container {
        display: flex;
        gap: 16px; /* Increased gap for better spacing */
        flex-shrink: 0;
        height: 60px;
        margin-top: 0;
        padding: 0 4px; /* Add padding to align with video container */
        align-items: center; /* Center buttons vertically */
    }

    .btn {
        flex: 1;
        padding: 0; /* Remove padding, use height instead */
        border: none;
        border-radius: 12px; /* Slightly more rounded */
        font-weight: 700; /* Bolder text */
        font-size: 18px; /* Larger text */
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1); /* Smoother animation */
        height: 52px; /* Specific height instead of 100% */
        display: flex;
        align-items: center;
        justify-content: center;
        letter-spacing: 1px; /* More letter spacing for impact */
        text-transform: uppercase; /* Uppercase text */
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        position: relative;
        overflow: hidden;
    }

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

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

    .btn:hover {
        transform: translateY(-3px) scale(1.02); /* Slight scale on hover */
        box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    }

    .btn:active {
        transform: translateY(-1px) scale(1.01);
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        transition: all 0.1s ease;
    }

    .btn-success {
        background: linear-gradient(135deg, #10b981, #059669); /* Modern green */
        color: white;
        border: 2px solid rgba(16, 185, 129, 0.3);
    }

    .btn-success:hover {
        background: linear-gradient(135deg, #059669, #047857);
        border-color: rgba(16, 185, 129, 0.5);
        box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    }

    .btn-danger {
        background: linear-gradient(135deg, #ef4444, #dc2626); /* Modern red */
        color: white;
        border: 2px solid rgba(239, 68, 68, 0.3);
    }

    .btn-danger:hover {
        background: linear-gradient(135deg, #dc2626, #b91c1c);
        border-color: rgba(239, 68, 68, 0.5);
        box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
    }

    /* Mobile button adjustments */
    @media (max-width: 767px) {
        .button-container {
            gap: 12px; /* Consistent gap */
            padding: 0 2px; /* Less padding on mobile */
        }
        
        .btn {
            font-size: 16px; /* Maintain readable size */
            height: 46px; /* Slightly smaller */
            letter-spacing: 0.5px; /* Reduce letter spacing */
        }
    }

    @media (max-width: 480px) {
        .button-container {
            gap: 10px; /* Smaller gap for tiny screens */
            padding: 0 2px;
        }
        
        .btn {
            font-size: 15px; /* Still readable */
            height: 44px; /* Compact but usable */
            border-radius: 10px; /* Slightly less rounded */
            letter-spacing: 0.5px;
        }
    }

    /* =================== ATTENDANCE LOGS STYLING =================== */
    .attendance-logs-container {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
    }

    .attendance-logs-container h6 {
        text-align: center;
        color: #666;
        margin: 0 0 12px 0;
        padding-bottom: 8px;
        font-size: 14px;
        font-weight: bold;
        border-bottom: 1px solid #eee;
        flex-shrink: 0;
    }

    .table-responsive {
        flex: 1;
        min-height: 0;
        overflow-y: auto !important;
    }

    .table {
        width: 100%;
        margin-bottom: 0;
        font-size: 12px;
        border-collapse: separate;
        border-spacing: 0 4px;
    }

    .table thead {
        position: sticky;
        top: 0;
        background-color: #fff;
        z-index: 1;
    }

    .table thead tr {
        display: none;
    }

    .table tbody tr {
        font-size: 11px;
    }

    .table td {
        padding: 4px 0;
        border: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    @media (max-width: 767px) {
        .attendance-logs-container h6 {
            margin-bottom: 10px;
            padding-bottom: 6px;
            font-size: 13px;
        }

        .table {
            font-size: 10px;
        }

        .table tbody tr {
            font-size: 10px;
        }

        .table td {
            padding: 3px 4px;
        }
    }

    @media (max-width: 480px) {
        .attendance-logs-container h6 {
            margin-bottom: 8px;
            padding-bottom: 6px;
            font-size: 12px;
        }

        .table {
            font-size: 9px;
        }

        .table tbody tr {
            font-size: 9px;
        }

        .table td {
            padding: 2px 3px;
        }
    }

    /* =================== RESPONSIVE ADJUSTMENTS =================== */
    
    /* Very small screens (phones in portrait) */
    @media (max-width: 480px) {
        .facial-recognition-container {
            padding: 4px;
            height: 100vh; /* Ensure full height */
        }
        
        .main-grid {
            gap: 6px;
            grid-template-rows: 1fr;
            height: calc(100vh - 60px);
            max-height: calc(100vh - 60px);
        }
        
        .content-section {
            gap: 6px;
            min-height: 0;
            overflow-y: auto;
            grid-template-rows: 1fr 1fr; /* Stack sidebar and video vertically */
        }
        
        .video-section {
            min-height: 240px; /* Ensure space for video + buttons */
            max-height: 280px; /* Limit to prevent overflow */
            order: 1; /* Video first on mobile */
        }
        
        .sidebar {
            min-height: 200px;
            max-height: 250px; /* Reasonable sidebar height */
            order: 2; /* Sidebar second on mobile */
            gap: 4px; /* Even smaller gap on tiny screens */
        }
        
        .bulletin-card {
            min-height: 140px; /* Maintain usable size even on tiny screens */
        }
        
        .bulletin-content {
            min-height: 80px;
        }
        
        .attendance-card {
            min-height: 100px;
        }
        
        .attendance-logs-container {
            max-height: 80px; /* Limit attendance log height */
            overflow-y: auto;
        }
    }

    /* Split screen / narrow width */
    @media (max-width: 600px) and (orientation: landscape) {
        .content-section {
            grid-template-columns: 1fr 1.2fr;
        }
        
        .sidebar {
            grid-template-rows: auto;
        }
        
        .bulletin-card {
            min-height: 60px;
        }
        
        .attendance-card {
            min-height: 120px;
        }
    }

    /* Large screens optimization */
    @media (min-width: 1200px) {
        .facial-recognition-container {
            padding: 16px;
            max-width: 1400px;
            margin: 0 auto;
        }
        
        .main-grid {
            gap: 16px;
        }
        
        .content-section {
            gap: 16px;
        }
        
        .card-body {
            padding: 20px;
        }
        
        .content-section {
            grid-template-columns: 1fr 1fr; /* More balanced on large screens */
        }
    }

    /* Ultra-wide screens */
    @media (min-width: 1600px) {
        .content-section {
            grid-template-columns: 1fr 1fr; /* Equal columns since video is size-limited */
        }
        
        .facial-recognition-container {
            max-width: 1600px; /* Prevent excessive stretching */
        }
    }

    /* =================== ACCESSIBILITY =================== */
    @media (prefers-reduced-motion: reduce) {
        .btn {
            animation: none;
            transition: none;
        }
    }

    /* High contrast mode */
    @media (prefers-contrast: high) {
        .card {
            border: 2px solid #000;
        }
        
        .btn {
            border: 2px solid currentColor;
        }
    }

    /* =================== ANNOUNCEMENT STYLES =================== */
    .announcement-item {
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .announcement-item:hover {
        background-color: #e9ecef !important;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .announcement-item:last-child {
        margin-bottom: 0 !important;
    }

    /* Responsive announcement text */
    @media (max-width: 768px) {
        .announcement-item h6 {
            font-size: 11px !important;
        }
        
        .announcement-item div {
            font-size: 10px !important;
        }
        
        .announcement-item span {
            font-size: 8px !important;
        }
    }

    @media (max-width: 480px) {
        .announcement-item {
            padding: 6px !important;
            margin-bottom: 8px !important;
        }
        
        .announcement-item h6 {
            font-size: 10px !important;
        }
        
        .announcement-item div {
            font-size: 9px !important;
        }
    }

    /* Loading animation for announcements */
    .announcement-loading {
        animation: pulse 2s infinite;
    }

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

    /* =================== ANNOUNCEMENT MODAL STYLES =================== */
    .announcement-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .announcement-modal-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        cursor: pointer;
    }

    .announcement-modal-content {
        background: white;
        border-radius: 12px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        max-width: 600px;
        max-height: 80vh;
        width: 90%;
        position: relative;
        transform: scale(0.9);
        transition: transform 0.3s ease;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .announcement-modal-header {
        background: linear-gradient(135deg, #16405F 0%, #1a4d6b 100%);
        color: white;
        padding: 20px 25px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 3px solid #f0f0f0;
        box-shadow: 0 2px 10px rgba(22, 64, 95, 0.3);
    }

    .announcement-modal-title {
        margin: 0;
        font-size: 20px;
        font-weight: 600;
        line-height: 1.3;
        flex: 1;
        padding-right: 20px;
    }

    .announcement-modal-close {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        font-size: 24px;
        width: 35px;
        height: 35px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.3s ease;
        flex-shrink: 0;
    }

    .announcement-modal-close:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }

    .announcement-modal-body {
        padding: 25px;
        overflow-y: auto;
        flex: 1;
    }

    .announcement-modal-dates {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        padding: 12px 15px;
        border-radius: 8px;
        margin-bottom: 15px;
        font-size: 14px;
        color: #495057;
        border-left: 4px solid #16405F;
        box-shadow: 0 2px 4px rgba(22, 64, 95, 0.1);
    }

    .announcement-modal-status {
        margin-bottom: 15px;
        display: flex;
        align-items: center;
    }

    .announcement-modal-text {
        color: #333;
        line-height: 1.6;
        font-size: 15px;
    }

    .announcement-modal-text h1, 
    .announcement-modal-text h2, 
    .announcement-modal-text h3 {
        color: #2c3e50;
        margin-top: 20px;
        margin-bottom: 10px;
    }

    .announcement-modal-text p {
        margin-bottom: 12px;
    }

    .announcement-modal-text strong {
        color: #495057;
    }

    .announcement-modal-event {
        margin-top: 15px;
    }

    /* Responsive modal */
    @media (max-width: 768px) {
        .announcement-modal-content {
            max-width: 95%;
            max-height: 85vh;
            margin: 20px;
        }
        
        .announcement-modal-title {
            font-size: 18px;
        }
        
        .announcement-modal-header {
            padding: 15px 20px;
        }
        
        .announcement-modal-body {
            padding: 20px;
        }
    }

    @media (max-width: 480px) {
        .announcement-modal-content {
            max-width: 100%;
            max-height: 90vh;
            margin: 10px;
            border-radius: 8px;
        }
        
        .announcement-modal-title {
            font-size: 16px;
        }
        
        .announcement-modal-text {
            font-size: 14px;
        }
    }

    /* Enhanced clickable announcement items */
    .clickable-announcement:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
        background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%) !important;
    }

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