/**
 * ALERT SYSTEM STYLES
 * ===================================================================
 * Toast notifications and alert messages
 * ===================================================================
 */

/* ===================================================================
   ALERT CONTAINER
   =================================================================== */
.alert-container {
    position: fixed;
    top: 80px; /* Below navbar */
    right: 20px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 420px;
    pointer-events: none;
}

.alert-container > * {
    pointer-events: auto;
}

/* ===================================================================
   ALERT BASE
   =================================================================== */
.alert {
    display: flex;
    align-items: flex-start;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    animation: slideInRight 0.3s ease-out;
    position: relative;
    backdrop-filter: blur(10px);
    min-width: 320px;
}

.alert.closing {
    animation: slideOutRight 0.3s ease-out forwards;
}

/* ===================================================================
   ALERT ANIMATIONS
   =================================================================== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ===================================================================
   ALERT VARIANTS
   =================================================================== */
.alert-success {
    background: linear-gradient(135deg, var(--success-light) 0%, #c3e6cb 100%);
    border-left: 4px solid var(--success);
    color: var(--success-dark);
}

.alert-error {
    background: linear-gradient(135deg, var(--error-light) 0%, #f5c6cb 100%);
    border-left: 4px solid var(--error);
    color: var(--error-dark);
}

.alert-warning {
    background: linear-gradient(135deg, var(--warning-light) 0%, #ffeeba 100%);
    border-left: 4px solid var(--warning);
    color: var(--warning-dark);
}

.alert-info {
    background: linear-gradient(135deg, var(--info-light) 0%, #bee5eb 100%);
    border-left: 4px solid var(--info);
    color: var(--info-dark);
}

/* ===================================================================
   ALERT ELEMENTS
   =================================================================== */
.alert-icon {
    font-size: 24px;
    margin-right: var(--spacing-md);
    flex-shrink: 0;
    line-height: 1;
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-message {
    font-size: var(--font-base);
    font-weight: var(--font-medium);
    line-height: 1.5;
    word-wrap: break-word;
}

.alert-close {
    background: none;
    border: none;
    font-size: 24px;
    font-weight: var(--font-bold);
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
    margin-left: var(--spacing-md);
    line-height: 1;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-close:hover {
    opacity: 1;
}

/* ===================================================================
   PROGRESS BAR (Auto-dismiss indicator)
   =================================================================== */
.alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    transition: width linear;
}

/* ===================================================================
   INLINE ALERTS (In-page alerts)
   =================================================================== */
.alert-inline {
    position: relative;
    margin-bottom: var(--spacing-lg);
    animation: none;
}

.alert-inline.alert-success {
    background: var(--success-light);
    border: 1px solid var(--success);
}

.alert-inline.alert-error {
    background: var(--error-light);
    border: 1px solid var(--error);
}

.alert-inline.alert-warning {
    background: var(--warning-light);
    border: 1px solid var(--warning);
}

.alert-inline.alert-info {
    background: var(--info-light);
    border: 1px solid var(--info);
}

/* ===================================================================
   RESPONSIVE - MOBILE
   =================================================================== */
@media (max-width: 768px) {
    .alert-container {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .alert {
        padding: var(--spacing-sm) var(--spacing-md);
        min-width: 0;
    }

    .alert-icon {
        font-size: 20px;
        margin-right: var(--spacing-sm);
    }

    .alert-message {
        font-size: var(--font-sm);
    }

    .alert-close {
        margin-left: var(--spacing-sm);
    }
}
