/* Announcement popups - professional official notice style */

.announcement-modal .modal-dialog {
    margin: 8% auto 6%;
    width: 80%;
    max-width: 90%;
}

/* Stack: New Membership at top, Renewal below, Budget Proposal below that */
#announcementNewMembership .modal-dialog {
    margin-top: 4%;
    margin-bottom: 2%;
}
#announcementOnlineRenewal .modal-dialog {
    margin-top: calc(4% + 200px + 12px);
    margin-bottom: 2%;
}
#announcementBudgetProposal .modal-dialog {
    margin-top: calc(4% + 420px + 12px);
    margin-bottom: 4%;
}

/* Mobile: compact modals, allow scroll to see all three. Push below fixed navbar. */
@media (max-width: 768px) {
    body.modal-open {
        overflow-y: auto !important;
    }
    .announcement-modal .modal-dialog {
        width: 94%;
        max-width: 94%;
        margin-left: auto;
        margin-right: auto;
    }
    /* Push first modal below fixed mobile menu (hamburger / three lines) */
    #announcementNewMembership .modal-dialog {
        margin-top: calc(64px + 4%) !important;
    }
    .announcement-modal .modal-content {
        max-height: none;
        overflow: visible;
    }
    .announcement-modal .modal-body {
        padding: 6px 10px 4px;
        font-size: 0.8rem;
    }
    .announcement-modal .announcement-message {
        font-size: 0.85rem;
    }
    .announcement-modal .announcement-detail {
        display: none;
    }
    .announcement-modal .announcement-notice-header {
        padding: 5px 10px;
        min-height: 32px;
    }
    .announcement-modal .announcement-notice-header .announcement-badge {
        font-size: 0.62rem;
    }
    .announcement-modal .announcement-notice-header .announcement-icon {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    .announcement-modal .announcement-notice-header .close {
        font-size: 1.25rem;
    }
    .announcement-modal .modal-footer {
        padding: 4px 10px 6px;
    }
    .announcement-modal .modal-footer .announcement-cta-btn {
        min-width: 80px;
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    /* Stack with tight gaps (minimal padding/fonts = compact modals) */
    #announcementNewMembership .modal-dialog {
        margin-top: calc(64px + 4%) !important;
        margin-bottom: 0;
    }
    #announcementOnlineRenewal .modal-dialog {
        margin-top: calc(64px + 4% + 80px + 6px);
        margin-bottom: 0;
    }
    #announcementBudgetProposal .modal-dialog {
        margin-top: calc(64px + 4% + 160px + 6px);
        margin-bottom: 2%;
    }
}

@media (max-width: 480px) {
    /* Very small screens: minimal fonts and padding */
    .announcement-modal .announcement-detail {
        display: none;
    }
    .announcement-modal .modal-content {
        max-height: none;
        overflow: visible;
    }
    .announcement-modal .announcement-notice-header {
        padding: 4px 8px;
        min-height: 28px;
    }
    .announcement-modal .announcement-notice-header .announcement-badge {
        font-size: 0.58rem;
    }
    .announcement-modal .announcement-notice-header .announcement-icon {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }
    .announcement-modal .announcement-notice-header .close {
        font-size: 1.15rem;
    }
    .announcement-modal .modal-body {
        padding: 4px 8px 4px;
        font-size: 0.75rem;
    }
    .announcement-modal .announcement-message {
        font-size: 0.8rem;
    }
    .announcement-modal .modal-footer {
        padding: 4px 8px 6px;
    }
    .announcement-modal .modal-footer .announcement-cta-btn {
        min-width: 75px;
        padding: 4px 8px;
        font-size: 0.72rem;
    }
    #announcementNewMembership .modal-dialog {
        margin-top: calc(64px + 3%) !important;
    }
    #announcementOnlineRenewal .modal-dialog {
        margin-top: calc(64px + 3% + 18vh + 4px);
    }
    #announcementBudgetProposal .modal-dialog {
        margin-top: calc(64px + 3% + 36vh + 4px);
    }
}

/* Renewal = hot/urgent (high z-index), Budget = secondary below */
#announcementOnlineRenewal {
    z-index: 1060;
    pointer-events: none;
}
#announcementOnlineRenewal .modal-dialog {
    pointer-events: auto;
}
#announcementBudgetProposal {
    z-index: 1050;
    pointer-events: auto;
}
#announcementNewMembership {
    z-index: 1060;
    pointer-events: none;
}
#announcementNewMembership .modal-dialog {
    pointer-events: auto;
}

.announcement-modal .modal-content {
    border: none;
    border-radius: 10px;
    box-shadow: 0 20px 56px rgba(30, 58, 95, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    border-left: 5px solid #d69e2e;
}

/* Header - contrasting blue (stands out from site green) */
.announcement-modal .announcement-notice-header {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 55%, #2b6cb0 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(30, 58, 95, 0.4);
}

.announcement-modal .announcement-notice-header .announcement-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.announcement-modal .announcement-notice-header .announcement-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.announcement-modal .announcement-notice-header .announcement-icon .fa {
    color: #fff;
}

.announcement-modal .announcement-notice-header .close {
    color: #fff;
    opacity: 0.9;
    text-shadow: none;
    font-size: 1.75rem;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.announcement-modal .announcement-notice-header .close:hover {
    opacity: 1;
}

/* Urgency variant - contrasting amber/orange (stands out from site green) */
.announcement-modal.announcement-urgency .modal-content {
    border-left-color: #d97706;
    box-shadow: 0 20px 56px rgba(180, 83, 9, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.announcement-modal.announcement-urgency .announcement-notice-header {
    background: linear-gradient(135deg, #92400e 0%, #b45309 40%, #d97706 100%);
    box-shadow: 0 2px 10px rgba(180, 83, 9, 0.4);
}

/* Secondary / low priority - softer green, no urgency */
.announcement-modal.announcement-secondary .modal-content {
    border-left-color: #38a169;
    box-shadow: 0 12px 40px rgba(56, 161, 105, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.announcement-modal.announcement-secondary .announcement-notice-header {
    background: linear-gradient(135deg, #276749 0%, #2f855a 50%, #38a169 100%);
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.3);
}
.announcement-modal.announcement-secondary .modal-footer .announcement-cta-btn {
    background: linear-gradient(135deg, #2f855a 0%, #38a169 100%);
    box-shadow: 0 2px 6px rgba(56, 161, 105, 0.35);
    animation: none;
}
.announcement-modal.announcement-secondary .modal-footer .announcement-cta-btn:hover {
    background: linear-gradient(135deg, #276749 0%, #2f855a 100%);
    box-shadow: 0 4px 10px rgba(56, 161, 105, 0.4);
}

/* Body - horizontal layout, less height */
.announcement-modal .modal-body {
    padding: 16px 24px 14px;
    background: #fff;
    font-family: inherit;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
}

/* All notices at once - two cards side by side */
.announcement-modal .announcement-all-notices-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
    align-items: stretch;
    padding: 20px 24px 16px;
}

@media (max-width: 768px) {
    .announcement-modal .announcement-all-notices-body {
        grid-template-columns: 1fr;
    }
}

.announcement-modal .announcement-notice-card {
    padding: 16px 18px;
    border-radius: 8px;
    border-left: 4px solid #2c5282;
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(44, 82, 130, 0.1);
}

.announcement-modal .announcement-notice-card-urgency {
    border-left-color: #d97706;
    background: #fffbeb;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.1);
}

.announcement-modal .announcement-notice-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.announcement-modal .announcement-notice-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2c5282 0%, #2b6cb0 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.announcement-modal .announcement-notice-card-urgency .announcement-notice-card-icon {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
}

.announcement-modal .announcement-notice-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #2c5282;
}

.announcement-modal .announcement-notice-card-urgency .announcement-notice-card-title {
    color: #b45309;
}

.announcement-modal .announcement-notice-card .announcement-message {
    font-size: 1.15rem;
    margin: 0 0 8px 0;
    min-width: 0;
}

.announcement-modal .announcement-notice-card .announcement-detail {
    font-size: 0.95rem;
    margin: 0;
    min-width: 0;
}

.announcement-modal .announcement-message {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    color: #1a202c;
    margin: 0;
    letter-spacing: 0.01em;
    flex: 1 1 auto;
    min-width: 200px;
}

.announcement-modal .announcement-detail {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.45;
    margin: 0;
    flex: 1 1 auto;
    min-width: 180px;
}

.announcement-modal .modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 10px 24px 12px;
    background: #f7fafc;
    border-radius: 0 0 10px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.announcement-modal .modal-footer .btn-primary,
.announcement-modal .modal-footer .announcement-cta-btn {
    min-width: 120px;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 1rem;
    background: linear-gradient(135deg, #2c5282 0%, #2b6cb0 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(44, 82, 130, 0.4);
    color: #fff;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.announcement-modal .modal-footer .btn-primary:hover,
.announcement-modal .modal-footer .announcement-cta-btn:hover {
    background: linear-gradient(135deg, #2a4365 0%, #2c5282 100%);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.5);
    color: #fff;
    text-decoration: none;
    transform: scale(1.05);
}

/* Popping animation for CTA buttons */
@keyframes announcementBtnPop {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(44, 82, 130, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 6px 20px rgba(44, 82, 130, 0.5);
    }
}

@keyframes announcementBtnPopUrgency {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 6px 20px rgba(217, 119, 6, 0.5);
    }
}

.announcement-modal .modal-footer .announcement-cta-btn {
    animation: announcementBtnPop 1.4s ease-in-out infinite;
}

.announcement-modal.announcement-urgency .modal-footer .announcement-cta-btn {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
    animation: announcementBtnPopUrgency 1.4s ease-in-out infinite;
}

.announcement-modal.announcement-urgency .modal-footer .announcement-cta-btn:hover {
    background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.5);
    color: #fff;
}

.announcement-modal .modal-footer .announcement-cta-btn:hover {
    animation: none;
}

/* Backdrop fade */
.announcement-modal .modal-backdrop {
    animation: announcementBackdropIn 0.2s ease-out;
}

/* Pop-in animation */
@keyframes announcementPopIn {
    0% {
        transform: scale(0.4);
        opacity: 0;
    }
    55% {
        transform: scale(1.06);
        opacity: 1;
    }
    75% {
        transform: scale(0.97);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Gentle repeating pulse so it keeps "popping" until closed */
@keyframes announcementKeepPop {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

/* Modal: no animation (buttons keep their pop animation) */
.announcement-modal.show .modal-dialog {
    animation: none;
}

.announcement-modal:not(.show) .modal-dialog {
    animation: none;
}

@keyframes announcementBackdropIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.5;
    }
}

/* Office notice image lightbox - opens on page, closeable */
.office-notice-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1070;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.office-notice-lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}
.office-notice-lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.office-notice-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.office-notice-lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: #fff;
    color: #333;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    z-index: 1;
}
.office-notice-lightbox-close:hover {
    background: #f0f0f0;
}
