/* Site-wide announcement banner styles */

.announcements-container {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    pointer-events: none;
}

.announcement-card {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 4px solid;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: background 0.3s ease, transform 0.3s ease;
}

.announcement-card:hover {
    transform: scale(1.02);
}

.announcement-card__icon {
    height: 20px;
    width: 20px;
    flex-shrink: 0;
    margin-right: 8px;
}

.announcement-card__icon svg {
    height: 100%;
    width: 100%;
}

.announcement-card__message {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
}

.announcement-card__dismiss {
    margin-left: auto;
    padding: 4px;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.announcement-card__dismiss:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.announcement-card__dismiss svg {
    height: 16px;
    width: 16px;
}

/* --- Type: Success (green) --- */

.announcement-card--success {
    background: #dcfce7;
    border-left-color: #22c55e;
    color: #14532d;
}

.announcement-card--success:hover {
    background: #bbf7d0;
}

.announcement-card--success .announcement-card__icon {
    color: #16a34a;
}

.announcement-card--success .announcement-card__dismiss {
    color: #16a34a;
}

.announcement-card--success .announcement-card__dismiss:hover {
    color: #14532d;
}

/* --- Type: Info (blue) --- */

.announcement-card--info {
    background: #dbeafe;
    border-left-color: #3b82f6;
    color: #1e3a5f;
}

.announcement-card--info:hover {
    background: #bfdbfe;
}

.announcement-card--info .announcement-card__icon {
    color: #2563eb;
}

.announcement-card--info .announcement-card__dismiss {
    color: #2563eb;
}

.announcement-card--info .announcement-card__dismiss:hover {
    color: #1e3a5f;
}

/* --- Type: Warning (yellow) --- */

.announcement-card--warning {
    background: #fef9c3;
    border-left-color: #eab308;
    color: #713f12;
}

.announcement-card--warning:hover {
    background: #fef08a;
}

.announcement-card--warning .announcement-card__icon {
    color: #ca8a04;
}

.announcement-card--warning .announcement-card__dismiss {
    color: #ca8a04;
}

.announcement-card--warning .announcement-card__dismiss:hover {
    color: #713f12;
}

/* --- Type: Error (red) --- */

.announcement-card--error {
    background: #fee2e2;
    border-left-color: #ef4444;
    color: #7f1d1d;
}

.announcement-card--error:hover {
    background: #fecaca;
}

.announcement-card--error .announcement-card__icon {
    color: #dc2626;
}

.announcement-card--error .announcement-card__dismiss {
    color: #dc2626;
}

.announcement-card--error .announcement-card__dismiss:hover {
    color: #7f1d1d;
}

/* --- Dark theme overrides --- */

[data-theme="dark"] .announcement-card--success {
    background: rgba(34, 197, 94, 0.15);
    color: #bbf7d0;
}

[data-theme="dark"] .announcement-card--success:hover {
    background: rgba(34, 197, 94, 0.22);
}

[data-theme="dark"] .announcement-card--success .announcement-card__dismiss {
    color: #bbf7d0;
}

[data-theme="dark"] .announcement-card--success .announcement-card__dismiss:hover {
    color: #ffffff;
}

[data-theme="dark"] .announcement-card--info {
    background: rgba(59, 130, 246, 0.15);
    color: #bfdbfe;
}

[data-theme="dark"] .announcement-card--info:hover {
    background: rgba(59, 130, 246, 0.22);
}

[data-theme="dark"] .announcement-card--info .announcement-card__dismiss {
    color: #bfdbfe;
}

[data-theme="dark"] .announcement-card--info .announcement-card__dismiss:hover {
    color: #ffffff;
}

[data-theme="dark"] .announcement-card--warning {
    background: rgba(234, 179, 8, 0.15);
    color: #fef08a;
}

[data-theme="dark"] .announcement-card--warning:hover {
    background: rgba(234, 179, 8, 0.22);
}

[data-theme="dark"] .announcement-card--warning .announcement-card__dismiss {
    color: #fef08a;
}

[data-theme="dark"] .announcement-card--warning .announcement-card__dismiss:hover {
    color: #ffffff;
}

[data-theme="dark"] .announcement-card--error {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
}

[data-theme="dark"] .announcement-card--error:hover {
    background: rgba(239, 68, 68, 0.22);
}

[data-theme="dark"] .announcement-card--error .announcement-card__dismiss {
    color: #fecaca;
}

[data-theme="dark"] .announcement-card--error .announcement-card__dismiss:hover {
    color: #ffffff;
}

/* --- Sunrise theme overrides --- */

[data-theme="sunrise"] .announcement-card--success {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

[data-theme="sunrise"] .announcement-card--success:hover {
    background: rgba(34, 197, 94, 0.18);
}

[data-theme="sunrise"] .announcement-card--info {
    background: rgba(59, 130, 246, 0.12);
    color: #1e3a5f;
}

[data-theme="sunrise"] .announcement-card--info:hover {
    background: rgba(59, 130, 246, 0.18);
}

[data-theme="sunrise"] .announcement-card--warning {
    background: rgba(234, 179, 8, 0.12);
    color: #713f12;
}

[data-theme="sunrise"] .announcement-card--warning:hover {
    background: rgba(234, 179, 8, 0.18);
}

[data-theme="sunrise"] .announcement-card--error {
    background: rgba(239, 68, 68, 0.12);
    color: #7f1d1d;
}

[data-theme="sunrise"] .announcement-card--error:hover {
    background: rgba(239, 68, 68, 0.18);
}

/* --- Purple theme overrides --- */

[data-theme="purple"] .announcement-card--success {
    background: rgba(34, 197, 94, 0.15);
    color: #bbf7d0;
}

[data-theme="purple"] .announcement-card--success:hover {
    background: rgba(34, 197, 94, 0.22);
}

[data-theme="purple"] .announcement-card--info {
    background: rgba(59, 130, 246, 0.15);
    color: #bfdbfe;
}

[data-theme="purple"] .announcement-card--info:hover {
    background: rgba(59, 130, 246, 0.22);
}

[data-theme="purple"] .announcement-card--warning {
    background: rgba(234, 179, 8, 0.15);
    color: #fef08a;
}

[data-theme="purple"] .announcement-card--warning:hover {
    background: rgba(234, 179, 8, 0.22);
}

[data-theme="purple"] .announcement-card--error {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
}

[data-theme="purple"] .announcement-card--error:hover {
    background: rgba(239, 68, 68, 0.22);
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .announcements-container {
        padding: 8px 10px 0;
    }
}
