/* ========================================================================= */
/* PRODUCT ANNOUNCEMENTS STYLESHEET                                          */
/* ========================================================================= */

/* Megaphone icon button placed left of profile buttons */
.product-announce-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--brokerly-text-secondary);
    margin-right: 8px;
    outline: none;
    position: relative;
}

.product-announce-btn:hover {
    transform: scale(1.05);
    color: var(--brokerly-primary);
    background: var(--brokerly-primary-light);
}

.product-announce-btn:active {
    transform: scale(0.95);
}

.product-announce-btn:focus-visible {
    outline: 2px solid var(--brokerly-primary);
    outline-offset: 2px;
}

.product-announce-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.product-announce-btn:hover svg {
    transform: rotate(-10deg);
}

/* Touch device target sizes */
@media (hover: none) and (pointer: coarse) {
    .product-announce-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        margin-right: 12px;
    }
}

/* ========================================================================= */
/* DRAWER SCROLL CONTENT & FEED                                              */
/* ========================================================================= */

.announce-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
}

.announce-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Premium Announcement Card */
.announce-card {
    background: var(--brokerly-secondary-background);
    border: 1px solid var(--brokerly-border-light);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-card-subtle);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease;
    cursor: pointer;
}

.announce-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-moderate);
    border-color: rgba(26, 127, 230, 0.15);
}

/* Card Header */
.announce-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid transparent;
    padding-bottom: 0;
    transition: border-color 0.25s ease, padding-bottom 0.25s ease;
}

.announce-card.expanded .announce-card-header {
    border-bottom-color: var(--brokerly-border-light);
    padding-bottom: 12px;
}

.announce-card:hover .announce-card-title {
    color: var(--brokerly-primary);
}

.announce-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--brokerly-text-primary);
    margin: 0;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.announce-card-date {
    font-size: 11px;
    font-weight: 600;
    color: var(--brokerly-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    background: var(--brokerly-tertiary-background);
    padding: 4px 8px;
    border-radius: 8px;
    margin-top: 1px;
}

/* Card Body & Markdown Styling */
.announce-card-body {
    font-size: 14.5px;
    color: var(--brokerly-text-secondary);
    line-height: 1.6;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, padding-top 0.4s ease;
    padding-top: 0;
}

.announce-card.expanded .announce-card-body {
    max-height: 5000px;
    opacity: 1;
    padding-top: 14px;
    overflow: visible;
}

/* Chevron Rotation */
.announce-card-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brokerly-text-tertiary);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.announce-card.expanded .announce-card-chevron {
    transform: rotate(180deg);
    color: var(--brokerly-primary);
}

.announce-card-body p {
    margin: 0 0 14px 0;
}

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

/* Emphasized Markdown text */
.announce-card-body strong {
    color: var(--brokerly-text-primary);
    font-weight: 700;
}

/* Inline Code tags */
.announce-card-body code {
    font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 12.5px;
    background: var(--brokerly-primary-light, rgba(26, 127, 230, 0.05));
    border: 1px solid rgba(26, 127, 230, 0.12);
    border-radius: 6px;
    padding: 3px 6px;
    color: var(--brokerly-primary);
    word-break: break-word;
    font-weight: 500;
}

/* Bullet list and number lists */
.announce-card-body ul, 
.announce-card-body ol {
    margin: 0 0 16px 0;
    padding-left: 22px;
}

.announce-card-body li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.announce-card-body li:last-child {
    margin-bottom: 0;
}

/* Rich Markdown Elements Styling */
.announce-card-body img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 16px auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--brokerly-border-light);
}

.announce-card-body a {
    color: var(--brokerly-primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.announce-card-body a:hover {
    border-bottom-color: var(--brokerly-primary);
}

.announce-card-body blockquote {
    margin: 16px 0;
    padding: 12px 18px;
    border-left: 4px solid var(--brokerly-primary);
    background: var(--brokerly-primary-light, rgba(26, 127, 230, 0.03));
    border-radius: 4px 12px 12px 4px;
    color: var(--brokerly-text-secondary);
    font-style: italic;
}

.announce-card-body pre {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
}

.announce-card-body pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 12.5px;
    color: #f8fafc;
    font-family: SFMono-Regular, Consolas, monospace;
    line-height: 1.5;
    font-weight: 400;
}

/* Heading Sizing & Margins */
.announce-card-body h1,
.announce-card-body h2,
.announce-card-body h3,
.announce-card-body h4,
.announce-card-body h5,
.announce-card-body h6 {
    color: var(--brokerly-text-primary);
    font-weight: 700;
    margin-top: 22px;
    margin-bottom: 10px;
    line-height: 1.35;
}

.announce-card-body h1 {
    font-size: 1.35rem;
    border-bottom: 1px solid var(--brokerly-border-light);
    padding-bottom: 6px;
    margin-top: 10px;
}

.announce-card-body h2 {
    font-size: 1.2rem;
    border-bottom: 1px dashed var(--brokerly-border-light);
    padding-bottom: 4px;
}

.announce-card-body h3 {
    font-size: 1.05rem;
}

.announce-card-body h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.announce-card-body h5 {
    font-size: 0.9rem;
    font-weight: 600;
}

.announce-card-body h6 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--brokerly-text-tertiary);
    letter-spacing: 0.05em;
}

.announce-card-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13.5px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--brokerly-border-light);
}

.announce-card-body th,
.announce-card-body td {
    padding: 10px 12px;
    border: 1px solid var(--brokerly-border-light);
    text-align: left;
}

.announce-card-body th {
    background: var(--brokerly-tertiary-background);
    font-weight: 600;
    color: var(--brokerly-text-primary);
}

.announce-card-body tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}


/* ========================================================================= */
/* STATE MANAGEMENT (Paging, Spinners, Empty & Errors)                       */
/* ========================================================================= */

/* Load More Paging Button */
.announce-load-more-container {
    margin-top: 16px;
    width: 100%;
}

.announce-load-more-btn {
    width: 100%;
    min-height: 44px;
    background: transparent;
    border: 1.5px solid var(--brokerly-primary);
    border-radius: 22px;
    color: var(--brokerly-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.announce-load-more-btn:hover {
    background: var(--brokerly-primary-light);
    transform: translateY(-1px);
}

.announce-load-more-btn:active {
    transform: translateY(0);
}

/* Loading Spinner */
.announce-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 0;
    color: var(--brokerly-text-secondary);
}

.announce-loading-spinner .spinner {
    width: 26px;
    height: 26px;
    border: 2.5px solid var(--brokerly-border-light);
    border-top: 2.5px solid var(--brokerly-primary);
    border-radius: 50%;
    animation: announce-spin 0.8s linear infinite;
}

.announce-loading-spinner .loading-text {
    font-size: 12px;
    font-weight: 500;
}

@keyframes announce-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty & Error States */
.announce-empty-state, 
.announce-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
}

.announce-empty-state h4, 
.announce-error-state h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--brokerly-text-primary);
    margin: 16px 0 8px 0;
}

.announce-empty-state p, 
.announce-error-state p {
    font-size: 13px;
    color: var(--brokerly-text-secondary);
    margin: 0;
    max-width: 280px;
    line-height: 1.45;
}

.announce-empty-state .empty-icon, 
.announce-error-state .error-icon {
    font-size: 44px;
}

.announce-retry-btn {
    margin-top: 20px;
    min-height: 40px;
    padding: 0 24px;
    background: var(--brokerly-primary);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
    transition: all 0.2s ease;
}

.announce-retry-btn:hover {
    background: var(--brokerly-primary-dark);
    transform: translateY(-1px);
}

.announce-retry-btn:active {
    transform: translateY(0);
}

/* ========================================================================= */
/* PREMIUM FLOATING DRAWER OVERRIDES                                         */
/* ========================================================================= */

.product-announce-drawer .sheet-content {
    /* Use standardized sizing of right-side panel drawers */
    background: var(--brokerly-background) !important;
}

/* Header customization */
.product-announce-drawer .sheet-header {
    background: var(--brokerly-secondary-background);
    border-bottom: 1px solid var(--brokerly-border-light);
}

/* Ensure backdrop blur supports standard modal layout */
.product-announce-drawer .sheet-backdrop {
    background: var(--brokerly-backdrop-bg);
}

/* ========================================================================= */
/* NOTIFICATION BADGE & UNREAD DOT                                           */
/* ========================================================================= */

.announce-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--brokerly-danger, #ff3b30);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--brokerly-background, #ffffff);
    box-sizing: content-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    line-height: 1;
    animation: badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badge-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.announce-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    min-width: 8px;
    min-height: 8px;
    border-radius: 50%;
    background-color: var(--brokerly-primary, #007aff);
    margin-right: 8px;
    flex-shrink: 0;
    align-self: center;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}

.announce-card-title {
    display: flex;
    align-items: center;
}

