/* Announcements & Markdown Shared Styles */

.ann-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ann-modal-container {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.2);
}

/* Modal scale animation for the real modal */
.ann-modal-overlay[style*="display: flex"] .ann-modal-container,
.ann-modal-overlay[style*="display:flex"] .ann-modal-container {
    animation: annScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Logo Splash Screen Animations --- */
.ann-modal-splash {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #fff;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeOutSplash 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: none;
}
.ann-modal-splash img {
    height: 52px;
    animation: scaleSplash 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeOutSplash {
    0% { opacity: 1; visibility: visible; }
    60% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}
@keyframes scaleSplash {
    0% { opacity: 0; transform: scale(0.9); }
    30% { opacity: 1; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.03); }
}
/* Delay visibility of the inner scroll so it reveals cleanly */
.ann-modal-header, .ann-modal-scroll {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.ann-modal-header { animation-delay: 1.1s; border-bottom: none; }
.ann-modal-scroll { animation-delay: 1.25s; }

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

@keyframes annScaleUp {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.ann-modal-header {
    padding: 24px 32px 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ann-main-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
    margin: 0;
}

.ann-btn-propose {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #3f3f46;
    cursor: pointer;
    transition: all 0.2s;
}

.ann-btn-propose:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.ann-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ann-modal-close:hover svg {
    stroke: #0f172a;
}

.ann-modal-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 32px 32px 32px;
}

/* Custom inline scrollbar */
.ann-modal-scroll::-webkit-scrollbar {
    width: 4px;
}
.ann-modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.ann-modal-scroll::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.ann-item {
    margin-bottom: 24px;
}

.ann-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ann-badge-new {
    background: #e6efff;
    color: #225aea;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.ann-date {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.ann-item-title {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.ann-media-wrapper {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    position: relative;
}

.ann-media-wrapper img,
.ann-media-wrapper video {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* Custom Swiper Controls */
.ann-media-wrapper .swiper-button-next,
.ann-media-wrapper .swiper-button-prev {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #111827;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ann-media-wrapper .swiper-button-next:hover,
.ann-media-wrapper .swiper-button-prev:hover {
    background-color: rgba(255, 255, 255, 1);
}

.ann-media-wrapper .swiper-button-next::after,
.ann-media-wrapper .swiper-button-prev::after {
    font-size: 14px;
    font-weight: bold;
}

.ann-media-wrapper .swiper-pagination-bullet-active {
    background: #2563eb;
}

.ann-media-wrapper .swiper-button-prev,
.ann-media-wrapper .swiper-button-next {
    margin-top: -16px;
}

.ann-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
}

.ann-custom-video {
    width: 100%;
    display: block;
    object-fit: cover;
    cursor: pointer;
}

.ann-mute-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.4);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(4px);
    z-index: 10;
    transition: background 0.2s;
}

.ann-mute-btn:hover {
    background: rgba(0,0,0,0.6);
}

.ann-video-progress-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    z-index: 10;
    transition: height 0.2s;
}

.ann-video-progress-wrap:hover {
    height: 8px;
}

.ann-video-progress-bar {
    height: 100%;
    background: #2563eb;
    width: 0%;
    pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   EXTENDED MARKDOWN STYLING
   ───────────────────────────────────────────────────────────────────────────── */

.ann-markdown {
    font-size: 15px !important;
    color: #374151 !important;
    line-height: 1.6 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Headers */
.ann-markdown h1, 
.ann-markdown h2, 
.ann-markdown h3, 
.ann-markdown h4 {
    color: #0f172a !important;
    font-weight: 700 !important;
    margin-top: 1.5em !important;
    margin-bottom: 0.75em !important;
    line-height: 1.3 !important;
    border: none !important; /* Reset potential parent styles */
    padding: 0 !important;
    background: transparent !important;
}

.ann-markdown h1 { font-size: 22px !important; line-height: 1.2 !important; }
.ann-markdown h2 { font-size: 18px !important; line-height: 1.3 !important; border-bottom: 1px solid #f1f5f9 !important; padding-bottom: 0.3em !important; }
.ann-markdown h3 { font-size: 16px !important; line-height: 1.4 !important; }
.ann-markdown h4 { font-size: 15px !important; line-height: 1.4 !important; }

/* Paragraphs & Spacing */
.ann-markdown p {
    margin-bottom: 1em !important;
    margin-top: 0 !important;
    font-size: inherit !important;
    color: inherit !important;
}

.ann-markdown p:last-child {
    margin-bottom: 0 !important;
}

/* Lists */
.ann-markdown ul, 
.ann-markdown ol {
    padding-left: 0 !important;
    margin-left: 1.25rem !important;
    margin-bottom: 1em !important;
    margin-top: 0.5em !important;
    list-style: none !important;
}

.ann-markdown ul > li, 
.ann-markdown ol > li {
    position: relative !important;
    padding-left: 0.5rem !important;
    margin-bottom: 0.5em !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

.ann-markdown ul > li::before {
    content: "•";
    position: absolute !important;
    left: -14px !important;
    color: #3b82f6 !important;
    font-weight: 900 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    top: 2px !important;
}

.ann-markdown ol { counter-reset: ann-counter !important; }
.ann-markdown ol > li { counter-increment: ann-counter !important; }
.ann-markdown ol > li::before {
    content: counter(ann-counter) ".";
    position: absolute !important;
    left: -1.25rem !important;
    color: #3b82f6 !important;
    font-weight: 700 !important;
}

/* Task Lists - Custom Styled Checkbox */
.ann-markdown ul li input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    border: 1.5px solid #94a3b8 !important; /* Darker border */
    border-radius: 4px !important;
    background-color: #fff !important;
    margin: 0 0.5em 0 -1.25rem !important;
    display: inline-block !important;
    vertical-align: middle !important;
    position: relative !important;
    cursor: default !important;
    transition: all 0.2s !important;
}

.ann-markdown ul li input[type="checkbox"]:checked {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

.ann-markdown ul li input[type="checkbox"]:checked::after {
    content: '' !important;
    position: absolute !important;
    left: 4.5px !important;
    top: 1px !important;
    width: 4px !important;
    height: 8px !important;
    border: solid white !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
}

.ann-markdown li.task-list-item::before {
    display: none !important;
}

/* Links */
.ann-markdown a {
    color: #2563eb !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    border-bottom: 1px solid transparent !important;
    transition: all 0.2s !important;
}

.ann-markdown a:hover {
    border-bottom-color: #2563eb !important;
    opacity: 0.8 !important;
}

/* Bold & Strong */
.ann-markdown strong, 
.ann-markdown b {
    font-weight: 700 !important;
    color: #0f172a !important;
}

/* Quotes */
.ann-markdown blockquote {
    margin: 1.5em 0 !important;
    padding: 0.5em 1.25em !important;
    border-left: 4px solid #3b82f6 !important; /* Blue accent to match lists */
    background: #f8fafc !important;
    border-radius: 0 8px 8px 0 !important;
    color: #475569 !important;
    font-style: italic !important;
}

.ann-markdown blockquote p {
    margin-bottom: 0 !important;
}

/* Code & Pre */
.ann-markdown code {
    background: #f1f5f9 !important;
    color: #ef4444 !important;
    padding: 0.2em 0.4em !important;
    border-radius: 4px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 0.9em !important;
}

.ann-markdown pre {
    background: #1e293b !important;
    color: #f8fafc !important;
    padding: 1.25em !important;
    border-radius: 12px !important;
    overflow-x: auto !important;
    margin: 1.5em 0 !important;
}

.ann-markdown pre code {
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    font-size: 0.85em !important;
    font-family: inherit !important;
}

/* Tables */
.ann-markdown table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 1.5em 0 !important;
    font-size: 0.95em !important;
}

.ann-markdown th, 
.ann-markdown td {
    padding: 10px 12px !important;
    border: 1px solid #e2e8f0 !important;
    text-align: left !important;
}

.ann-markdown th {
    background: #f8fafc !important;
    font-weight: 600 !important;
    color: #0f172a !important;
}

/* Horizontal Rule - Wavy Line */
.ann-markdown hr {
    border: none !important;
    height: 8px !important;
    background: url("data:image/svg+xml,%3Csvg width='12' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 3 Q 3 0 6 3 T 12 3' fill='none' stroke='%23cbd5e1' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x !important;
    margin: 2em 0 !important;
    opacity: 0.8 !important;
}

/* Images inside markdown */
.ann-markdown img {
    max-width: 100% !important;
    border-radius: 8px !important;
    margin: 1em 0 !important;
}

/* Strikethrough */
.ann-markdown del {
    color: #94a3b8 !important;
    text-decoration: line-through !important;
}

/* Announcement Divider (Wave) */
.ann-divider {
    border: none;
    height: 6px;
    margin: 32px auto;
    width: 80%;
    max-width: 450px;
    background: url("data:image/svg+xml,%3Csvg width='12' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 3 Q 3 0 6 3 T 12 3' fill='none' stroke='%23cbd5e1' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
    opacity: 0.6;
}

.ann-caught-up {
    text-align: center;
    padding: 40px 0 20px 0;
}

.ann-caught-up p {
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    margin: 0;
}
