/* ============================================
   Republic Financial - Alert Component Library
   ============================================ */

/* Base Alert */
.alert-factsheet {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    margin-bottom: var(--space-4);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.alert-icon {
    flex-shrink: 0;
    font-size: var(--text-lg);
}

.alert-content {
    flex-grow: 1;
}

.alert-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
}

.alert-message {
    font-size: var(--text-sm);
    line-height: 1.5;
}

.alert-close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: var(--transition-all);
}

.alert-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .alert-close:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Alert Variants */
.alert-factsheet.alert-success {
    background: color-mix(in srgb, var(--color-success) 12%, var(--bg-card));
    border-color: color-mix(in srgb, var(--color-success) 30%, var(--bg-card));
    color: var(--color-success-dark);
}

.alert-factsheet.alert-warning {
    background: color-mix(in srgb, var(--color-warning) 12%, var(--bg-card));
    border-color: color-mix(in srgb, var(--color-warning) 30%, var(--bg-card));
    color: var(--color-warning-dark);
}

.alert-factsheet.alert-danger {
    background: color-mix(in srgb, var(--color-danger) 12%, var(--bg-card));
    border-color: color-mix(in srgb, var(--color-danger) 30%, var(--bg-card));
    color: var(--color-danger-dark);
}

.alert-factsheet.alert-info {
    background: color-mix(in srgb, var(--color-info) 12%, var(--bg-card));
    border-color: color-mix(in srgb, var(--color-info) 30%, var(--bg-card));
    color: var(--color-info-dark);
}

/* Solid Alert Variant */
.alert-factsheet.alert-solid {
    color: white;
}

.alert-factsheet.alert-solid.alert-success {
    background: var(--color-success);
    border-color: var(--color-success);
}

.alert-factsheet.alert-solid.alert-warning {
    background: var(--color-warning);
    border-color: var(--color-warning);
    color: var(--text-primary);
}

.alert-factsheet.alert-solid.alert-danger {
    background: var(--color-danger);
    border-color: var(--color-danger);
}

.alert-factsheet.alert-solid.alert-info {
    background: var(--color-info);
    border-color: var(--color-info);
}

/* Outlined Alert Variant */
.alert-factsheet.alert-outlined {
    background: transparent;
    border-width: 2px;
}

.alert-factsheet.alert-outlined.alert-success {
    border-color: var(--color-success);
    color: var(--color-success);
}

.alert-factsheet.alert-outlined.alert-warning {
    border-color: var(--color-warning);
    color: var(--color-warning);
}

.alert-factsheet.alert-outlined.alert-danger {
    border-color: var(--color-danger);
    color: var(--color-danger);
}

.alert-factsheet.alert-outlined.alert-info {
    border-color: var(--color-info);
    color: var(--color-info);
}

/* Banner Alert */
.alert-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--space-3) var(--space-4);
    text-align: center;
    z-index: 999;
    transform: translateY(-100%);
    transition: var(--transition-all);
}

.alert-banner.show {
    transform: translateY(0);
}

.alert-banner.alert-success {
    background: var(--color-success);
    color: white;
}

.alert-banner.alert-warning {
    background: var(--color-warning);
    color: var(--text-primary);
}

.alert-banner.alert-danger {
    background: var(--color-danger);
    color: white;
}

.alert-banner.alert-info {
    background: var(--color-info);
    color: white;
}

/* Inline Alert */
.alert-inline {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
}

.alert-inline.alert-success {
    background: color-mix(in srgb, var(--color-success) 12%, var(--bg-card));
    color: var(--color-success);
}

.alert-inline.alert-warning {
    background: color-mix(in srgb, var(--color-warning) 12%, var(--bg-card));
    color: var(--color-warning);
}

.alert-inline.alert-danger {
    background: color-mix(in srgb, var(--color-danger) 12%, var(--bg-card));
    color: var(--color-danger);
}

.alert-inline.alert-info {
    background: color-mix(in srgb, var(--color-info) 12%, var(--bg-card));
    color: var(--color-info);
}

/* Notification Badge */
.notification-badge {
    position: relative;
    display: inline-block;
}

.notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 var(--space-1);
    background: var(--color-danger);
    color: white;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

.notification-count.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-danger) 70%, transparent);
    }
    70% {
        box-shadow: 0 0 0 10px transparent;
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-2);
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-all);
    z-index: 100;
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-title {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.notification-clear {
    font-size: var(--text-sm);
    color: var(--brand-primary);
    cursor: pointer;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    gap: var(--space-3);
    transition: var(--transition-all);
    cursor: pointer;
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: color-mix(in srgb, var(--brand-primary) 5%, var(--bg-card));
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: var(--space-1);
    flex-shrink: 0;
}

.notification-dot.success {
    background: var(--color-success);
}

.notification-dot.warning {
    background: var(--color-warning);
}

.notification-dot.danger {
    background: var(--color-danger);
}

.notification-dot.info {
    background: var(--color-info);
}

.notification-content {
    flex-grow: 1;
}

.notification-text {
    font-size: var(--text-sm);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.notification-time {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.notification-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-primary);
    text-align: center;
}

.notification-footer a {
    color: var(--brand-primary);
    font-size: var(--text-sm);
}

/* System Messages */
.system-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-2xl);
    max-width: 400px;
    text-align: center;
    z-index: 1100;
}

.system-message-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: var(--text-2xl);
}

.system-message-icon.success {
    background: color-mix(in srgb, var(--color-success) 15%, var(--bg-card));
    color: var(--color-success);
}

.system-message-icon.error {
    background: color-mix(in srgb, var(--color-danger) 15%, var(--bg-card));
    color: var(--color-danger);
}

.system-message-text {
    font-size: var(--text-lg);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.system-message-subtext {
    font-size: var(--text-sm);
    color: var(--text-muted);
}