/* =============================================================================
   Cadeo — Announcement Display Styles
   Modal overlay for in-app announcements + activity panel integration
   Font: Avenir Next  |  Colors: brand reference  |  Grid: 8px base
   ============================================================================= */

/* ── Backdrop ──────────────────────────────────────────────────────────────── */

.announcement-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    transition: opacity 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.announcement-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Modal ─────────────────────────────────────────────────────────────────── */

.announcement-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    z-index: 9999;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    max-width: 420px;
    width: calc(100% - 48px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.06);
    font-family: 'Avenir Next', 'Avenir', -apple-system, BlinkMacSystemFont, sans-serif;
    opacity: 0;
    transition: opacity 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.announcement-modal.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* ── Label ─────────────────────────────────────────────────────────────────── */

.announcement-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4a90d9;
    margin-bottom: 8px;
}

/* ── Title ─────────────────────────────────────────────────────────────────── */

.announcement-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
    line-height: 1.3;
}

/* ── Body ──────────────────────────────────────────────────────────────────── */

.announcement-body {
    font-size: 13px;
    font-weight: 400;
    color: #636366;
    line-height: 1.6;
    margin-bottom: 16px;
}

.announcement-body p {
    margin: 0 0 8px;
}

.announcement-body p:last-child {
    margin-bottom: 0;
}

.announcement-body a {
    color: #4a90d9;
    text-decoration: none;
}

.announcement-body a:hover {
    text-decoration: underline;
}

.announcement-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

.announcement-body code {
    background: #f2f2f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.announcement-body blockquote {
    border-left: 3px solid #4a90d9;
    margin: 8px 0;
    padding: 4px 12px;
    color: #8e8e93;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */

.announcement-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.announcement-deep-link {
    font-size: 12px;
    font-weight: 500;
    color: #4a90d9;
    text-decoration: none;
    cursor: pointer;
}

.announcement-deep-link:hover {
    text-decoration: underline;
}

.announcement-dismiss-btn {
    background: #4a90d9;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-family: 'Avenir Next', 'Avenir', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-height: 36px;
    transition: background-color 100ms ease;
}

.announcement-dismiss-btn:hover {
    background: #357ABD;
}

.announcement-dismiss-btn:focus-visible {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

/* ── Activity panel: announcement row ─────────────────────────────────────── */

.activity-item[data-type="announcement"] .activity-icon {
    color: #4a90d9;
}

/* ── Dark mode (prefers-color-scheme) ─────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    .announcement-modal {
        background: #1c1c1e;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
    }

    .announcement-title {
        color: #f5f5f7;
    }

    .announcement-body {
        color: #8e8e93;
    }

    .announcement-body code {
        background: #2c2c2e;
    }

    .announcement-backdrop {
        background: rgba(0, 0, 0, 0.5);
    }
}

/* ── Dark mode (app theme class) ──────────────────────────────────────────── */

.dark-mode .announcement-modal,
[data-theme="dark"] .announcement-modal {
    background: #1c1c1e;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.dark-mode .announcement-title,
[data-theme="dark"] .announcement-title {
    color: #f5f5f7;
}

.dark-mode .announcement-body,
[data-theme="dark"] .announcement-body {
    color: #8e8e93;
}

.dark-mode .announcement-body code,
[data-theme="dark"] .announcement-body code {
    background: #2c2c2e;
}

.dark-mode .announcement-backdrop,
[data-theme="dark"] .announcement-backdrop {
    background: rgba(0, 0, 0, 0.5);
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .announcement-modal,
    .announcement-backdrop {
        transition: none;
    }
}
