/**
 * Fix Notice Board Issues
 * Add this CSS file after the main CSS
 */

/* Fix: Show all notices by default on page load */
.notice-board-wrapper .notices-list:not(:has(.notice-items)) .no-notices {
    display: none !important;
}

/* Fix: Footer jump issue */
.notice-board-container {
    min-height: 200px; /* Prevent container collapse */
    position: relative;
}

.notice-items {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.notice-board-container.loading .notice-items {
    opacity: 0.5;
}

/* Fix: Make tabs load properly */
.tab-nav .tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: currentColor;
    border-radius: 3px;
}

/* Fix: Prevent layout shift during loading */
.notice-board-wrapper {
    contain: layout style paint;
}

.notice-item {
    will-change: transform;
    backface-visibility: hidden;
}

/* Fix: Smooth transitions */
.notice-board-wrapper {
    transform: translateZ(0);
}

/* Fix: Loading spinner positioning */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Fix: Ensure content stays in place */
.site-footer {
    clear: both;
    position: relative;
    z-index: 1;
}

/* Fix: Tab loading animation */
.tab-nav {
    position: relative;
}

.tab-nav::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.tab-nav .tab-link {
    position: relative;
    z-index: 1;
}

/* Fix: Remove initial empty state flash */
.notice-board-wrapper:not(.initialized) .no-notices {
    opacity: 0;
    visibility: hidden;
}

.notice-board-wrapper.initialized .no-notices {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

/* Fix: Content reflow prevention */
.notice-board-container {
    overflow: hidden;
}

.notice-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fix: Footer position */
body:has(.notice-board-wrapper) .site-footer {
    margin-top: auto;
}

/* Fix: Initial load state */
.notice-board-wrapper[data-initial-load="true"] .notice-items {
    animation: none;
}

/* Fix: Ensure proper spacing */
.notice-board-wrapper {
    margin-bottom: 40px;
}