
/* Filter bar */
.filter-bar { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; margin-bottom: 1.75rem; padding: 1rem 1.25rem; background: white; border-radius: 10px; border: 1px solid #f0e8e8; box-shadow: 0 2px 6px rgba(45,5,7,0.04); }
.filter-bar label { font-size: 0.8rem; font-weight: 600; color: #2d0507; white-space: nowrap; }
.filter-bar select { padding: 0.5rem 0.85rem; border: 1px solid #e8c8c8; border-radius: 8px; font-size: 0.86rem; font-family: inherit; background: #faf8f5; }
.filter-bar input  { padding: 0.5rem 0.85rem; border: 1px solid #e8c8c8; border-radius: 8px; font-size: 0.86rem; font-family: inherit; background: #faf8f5; flex: 1; min-width: 200px; }
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: #7b1113; }

/* Notice card styling */
.notice-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0.25rem 1.75rem;
    box-shadow: 0 4px 12px rgba(45,5,7,0.03);
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}
.notice-card:hover { 
    box-shadow: 0 10px 30px rgba(123,17,19,0.08); 
    transform: translateY(-3px); 
    border-color: #e8c8c8;
}

.notice-date-box {
    grid-row: span 2;
    min-width: 70px;
    background: #fdf0e0;
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    flex-shrink: 0;
    height: fit-content;
}
.notice-date-box .day   { display: block; font-size: 1.6rem; font-weight: 800; color: #7b1113; font-family: 'Outfit', sans-serif; line-height: 1; }
.notice-date-box .month { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: #c4893a; font-weight: 700; margin-top: 0.2rem; }

.notice-header-info { grid-column: 2; grid-row: 1; min-width: 0; }
.notice-title { 
    font-size: 1.08rem; 
    font-weight: 800; 
    color: #2d0507; 
    margin-bottom: 0.35rem; 
    line-height: 1.4; 
}

.notice-meta-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    vertical-align: middle;
    margin-left: 0.6rem;
}

.n-badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.n-exam    { background: #fee2e2; color: #b91c1c; }
.n-event   { background: #fef3c7; color: #92400e; }
.n-general { background: #f0fdf4; color: #166534; }

.attachment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7b1113;
    transition: all 0.2s;
    background: #fdf0e0;
    border-radius: 50%;
}
@media (hover: hover) {
    .attachment-icon:hover { transform: scale(1.1); background: #7b1113; color: white; }
}
.attachment-icon.small { width: 26px; height: 26px; font-size: 0.72rem; }

.notice-text { 
    grid-column: 2;
    grid-row: 2;
    font-size: 0.9rem; 
    color: #64748b; 
    margin-bottom: 0; 
    line-height: 1.6; 
}

.desktop-only { display: inline-block; }
.mobile-only { display: none; }

.empty-state { text-align:center; padding:4rem 2rem; color:#6b5c5c; }
.empty-state i { font-size:3rem; color:#e8c8c8; display:block; margin-bottom:1rem; }

@media (max-width: 600px) {
    .desktop-only { display: none; }
    .mobile-only { display: inline-block; }
    
    .notice-card { 
        padding: 1.25rem; 
        gap: 0.5rem 0.75rem; 
    }
    
    .notice-date-box {
        grid-row: 1;
        min-width: 55px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0.35rem 0.25rem;
        border-radius: 8px;
        height: auto; 
        align-self: stretch; /* Match header info height */
    }
    .notice-date-box .day { font-size: 1.1rem; line-height: 1; }
    .notice-date-box .month { font-size: 0.55rem; line-height: 1; }

    .notice-header-info {
        grid-row: 1;
        grid-column: 2;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 2.8rem;
        gap: 3px;
    }

    .notice-title { 
        font-size: 0.95rem; 
        line-height: 1.2;
        margin-bottom: 0;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .notice-meta-row { 
        display: flex; 
        align-items: center; 
        gap: 0.6rem; 
    }
    .attachment-icon i { font-size: 0.75rem; }
    
    .notice-text { 
        grid-row: 2;
        grid-column: 1 / span 2; /* Full width flow */
        font-size: 0.88rem; 
        -webkit-line-clamp: 3; 
        margin-top: 0.35rem;
    }
    
    .attachment-icon { background: none !important; color: #7b1113 !important; }
    .attachment-icon:hover { background: none !important; transform: none !important; }
}

/* Floating Back Button - Positioned in the left margin area */
#main-back-btn { 
    display: inline-flex; align-items: center; gap: 0.6rem; background: white; 
    border: 1px solid #e2e8f0; padding: 0.75rem 1.25rem; border-radius: 12px; 
    font-weight: 600; color: #475569; cursor: pointer; transition: all 0.25s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); width: fit-content; font-size: 0.95rem;
}
#main-back-btn:hover { border-color: #7b1113; color: #7b1113; box-shadow: 0 6px 15px rgba(123,17,19,0.15); transform: translateY(-2px); }

@media (min-width: 1100px) {
    #main-back-btn {
        position: absolute;
        left: -130px;
        top: 0;
    }
}

@media (max-width: 1099px) {
    #main-back-btn {
        margin-bottom: 1.25rem;
    }
}

.nd-card { 
    background: white; border-radius: 24px; box-shadow: 0 12px 50px rgba(45,5,7,0.06); 
    border: 1px solid #f1f5f9; overflow: hidden;
}

.nd-upper { display: flex; gap: 4rem; padding: 2.5rem; position: relative; }
.nd-sidebar { 
    width: 100px; flex-shrink: 0; display: flex; flex-direction: column; 
}
/* Aligns the title vertically with the date box */
.nd-upper-main { 
    flex: 1; min-width: 0; padding-top: 1rem; 
}

.nd-card-divider { border: 0; border-top: 1.5px solid #f8fafc; margin: 0; }

.nd-lower { padding: 2.5rem; }

.nd-badges-stack { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }

/* Enforce Matching Widths */
.nd-date-badge, .desktop-badges .n-badge { 
    width: 90px !important; min-width: 90px !important; text-align: center;
    box-sizing: border-box; display: inline-block; padding-left: 0 !important; padding-right: 0 !important;
}

.nd-date-badge { 
    background: white; border: 1.5px solid #fdf0e0; padding: 0.9rem 0; 
    border-radius: 12px; box-shadow: 0 4px 12px rgba(123,17,19,0.03);
}
.nd-date-badge .day { display: block; font-size: 1.45rem; font-weight: 800; color: #7b1113; line-height: 1; font-family: 'Outfit', sans-serif; }
.nd-date-badge .month { display: block; font-size: 0.62rem; text-transform: uppercase; font-weight: 700; color: #c4893a; margin-top: 0.2rem; }

.desktop-badges .n-badge {
    padding: 0.45rem 0; border-radius: 8px; font-size: 0.65rem; font-weight: 800;
}

.nd-title { font-size: 2.1rem; line-height: 1.35; font-weight: 800; color: #2d0507; margin: 0; font-family: 'Outfit', sans-serif; }

/* Mobile Type Badge (Inline after title) */
.mobile-only-inline { 
    display: none; 
    margin-left: 1rem; 
    font-size: 0.65rem !important; 
    vertical-align: middle; 
}

.nd-content { font-size: 1.15rem; line-height: 2; color: #475569; white-space: pre-wrap; font-family: 'Inter', sans-serif; }

/* Inline clickable links within notice content */
.nd-inline-link {
    color: #7b1113;
    text-decoration: underline;
    text-decoration-color: rgba(123, 17, 19, 0.3);
    text-underline-offset: 3px;
    font-weight: 500;
    transition: color 0.2s, text-decoration-color 0.2s;
    word-break: break-all;
}
.nd-inline-link:hover {
    color: #5a0c0e;
    text-decoration-color: #5a0c0e;
}

.nd-actions { 
    margin-top: 3.5rem; 
    padding-top: 1rem; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 1rem;
    flex-wrap: wrap;
}

/* Premium Action Button */
.btn-attachment {
    background: #7b1113; color: white !important; border: none; padding: 0.85rem 2rem;
    border-radius: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 0.9rem;
    transition: all 0.2s; cursor: pointer; text-decoration: none; box-shadow: 0 4px 15px rgba(123,17,19,0.15);
    font-family: 'Inter', sans-serif; font-size: 1rem;
}
.btn-attachment:hover { background: #5a0c0e; transform: translateY(-3px); box-shadow: 0 8px 25px rgba(123,17,19,0.25); }

/* Share Button */
.btn-share {
    display: inline-flex; align-items: center; gap: 0.6rem;
    background: white; color: #7b1113; border: 2px solid #7b1113;
    padding: 0.75rem 1.5rem; border-radius: 12px;
    font-weight: 700; font-family: 'Inter', sans-serif; font-size: 0.95rem;
    cursor: pointer; transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(123,17,19,0.08);
    flex-shrink: 0;
}
.btn-share:hover {
    background: #7b1113; color: white;
    box-shadow: 0 6px 20px rgba(123,17,19,0.2);
    transform: translateY(-2px);
}
.btn-share:active { transform: translateY(0); }
.btn-share i { font-size: 0.9rem; }

/* Toast notification */
.nd-toast {
    position: fixed; bottom: -60px; left: 50%; transform: translateX(-50%);
    background: #1e293b; color: white; padding: 0.85rem 1.75rem;
    border-radius: 12px; font-size: 0.9rem; font-weight: 600;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 9999; transition: bottom 0.3s ease;
    white-space: nowrap;
}
.nd-toast.show { bottom: 2rem; }

/* Error Handling */
.error-container { text-align: center; padding: 5rem 2rem; background: #fffcfc; border-radius: 20px; border: 1px solid #fee2e2; }
.error-graphic { font-size: 4rem; color: #e8c8c8; margin-bottom: 2rem; }

.spinner-premium { width: 45px; height: 45px; border: 4px solid #fdf0e0; border-top-color: #7b1113; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
    .nd-upper { flex-direction: row; gap: 1.25rem; padding: 1.5rem 1.25rem; align-items: flex-start; }
    
    /* Mobile Header Stacking - Date + Badge on left, Title on right */
    .nd-sidebar { 
        width: 80px; 
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    .nd-date-badge { width: 80px !important; min-width: 80px !important; }
    
    /* Type Badge below date card on mobile */
    .desktop-badges { display: block !important; }
    .desktop-badges .n-badge { width: 80px !important; min-width: 80px !important; }
    
    .nd-upper-main { padding-top: 0; }
    .nd-title { font-size: 1.28rem; line-height: 1.4; }
    
    /* Hide the inline version on mobile as well */
    .mobile-only-inline { display: none !important; }

    .nd-lower { padding: 1.5rem 1.25rem; }
    .nd-content { font-size: 1rem; }

    .nd-actions { margin-top: 2rem; }
    .btn-attachment { padding: 0.7rem 1.4rem; font-size: 0.88rem; gap: 0.6rem; }
    .btn-share { padding: 0.65rem 1rem; font-size: 0.85rem; }
    .btn-share span { display: none; }
}

/* Reduce gap below header */
main.section:has(.nd-card) { padding-top: 1.5rem; }
@media (max-width: 800px) {
    main.section:has(.nd-card) { padding-top: 1rem; }
}
