/* ============================================
   ALERT POPUP CSS - Theme aware alert system
   Compatible with auth pages and main application
   ============================================ */

/* Main alert container - positioned fixed for global alerts */
.alert-container {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    max-width: 90vw;
    background: var(--surface-color, #ffffff);
    border-radius: 24px;
    padding: 0;
    text-align: center;
    z-index: 10000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-left: 4px solid transparent;
    animation: alertSlideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    overflow: hidden;
}

/* Alert content wrapper */
.alert-container > div {
    padding: 24px;
}

/* Alert types */
.alert-container.success {
    border-left-color: var(--electric-lime, #06C506);
    background: var(--surface-color, #ffffff);
}

.alert-container.danger,
.alert-container.error {
    border-left-color: #f44336;
    background: var(--surface-color, #ffffff);
}

.alert-container.warning {
    border-left-color: #ff9800;
    background: var(--surface-color, #ffffff);
}

.alert-container.info {
    border-left-color: var(--sapphire-blue, #0066CC);
    background: var(--surface-color, #ffffff);
}

/* Alert header */
.alert-container h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color, #000000);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Add icons to alert headers via pseudo-elements */
.alert-container.success h4::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--electric-lime, #06C506);
}

.alert-container.danger h4::before,
.alert-container.error h4::before {
    content: '\f06a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #f44336;
}

.alert-container.warning h4::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #ff9800;
}

.alert-container.info h4::before {
    content: '\f05a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--sapphire-blue, #0066CC);
}

/* Alert message */
.alert-container p {
    margin: 0 0 20px 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--secondary-text-color, #666666);
    text-align: center;
    padding: 0 8px;
}

/* Alert close button */
.alert-close-button {
    background: linear-gradient(135deg, var(--sapphire-blue, #0066CC), var(--electric-lime, #06C506));
    border: none;
    padding: 10px 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    color: white;
    min-width: 120px;
    box-shadow: 0 4px 10px rgba(6, 197, 6, 0.2);
}

.alert-close-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(6, 197, 6, 0.3);
}

.alert-close-button.success {
    background: linear-gradient(135deg, var(--sapphire-blue, #0066CC), var(--electric-lime, #06C506));
}

.alert-close-button.danger,
.alert-close-button.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    box-shadow: 0 4px 10px rgba(244, 67, 54, 0.2);
}

.alert-close-button.warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.2);
}

.alert-close-button.info {
    background: linear-gradient(135deg, var(--sapphire-blue, #0066CC), #1976D2);
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.2);
}

/* ============================================
   AUTHX ALERT SYSTEM - For inline alerts in auth pages
   Compatible with the authx- class system
   ============================================ */

.authx-alert {
    margin-bottom: 24px;
    padding: 16px;
    border-radius: 16px;
    background: var(--surface-color, #ffffff);
    border-left: 4px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    animation: slideInDown 0.3s ease;
}

.authx-alert-success {
    border-left-color: var(--electric-lime, #06C506);
    background: rgba(6, 197, 6, 0.05);
}

.authx-alert-error {
    border-left-color: #f44336;
    background: rgba(244, 67, 54, 0.05);
}

.authx-alert-warning {
    border-left-color: #ff9800;
    background: rgba(255, 152, 0, 0.05);
}

.authx-alert-info {
    border-left-color: var(--sapphire-blue, #0066CC);
    background: rgba(0, 102, 204, 0.05);
}

.authx-alert-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex: 1;
}

.authx-alert-content i {
    font-size: 1.2rem;
    margin-top: 2px;
}

.authx-alert-success .authx-alert-content i {
    color: var(--electric-lime, #06C506);
}

.authx-alert-error .authx-alert-content i {
    color: #f44336;
}

.authx-alert-warning .authx-alert-content i {
    color: #ff9800;
}

.authx-alert-info .authx-alert-content i {
    color: var(--sapphire-blue, #0066CC);
}

.authx-alert-text {
    flex: 1;
}

.authx-alert-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color, #000000);
}

.authx-alert-message {
    font-size: 0.9rem;
    color: var(--secondary-text-color, #666666);
    margin: 0;
    line-height: 1.5;
}

.authx-alert-close {
    background: none;
    border: none;
    color: var(--secondary-text-color, #666666);
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.authx-alert-close:hover {
    color: var(--text-color, #000000);
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

/* ============================================
   BLUR EFFECT - For page overlay when alert is shown
   ============================================ */
.blur-effect {
    filter: blur(4px);
    pointer-events: none;
    transition: filter 0.3s ease;
}

/* ============================================
   MODAL STYLES - For custom alert modals
   ============================================ */
.modal .modal-dialog {
    background-color: transparent;
    pointer-events: auto;
    max-width: 450px;
    margin: 1.75rem auto;
}

.modal-content {
    background: var(--surface-color, #ffffff);
    border-radius: 32px;
    border: 1px solid var(--border-color, #e0e0e0);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    padding: 0;
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    position: relative;
}

.modal-header .modal-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color, #000000);
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Add icon to modal title based on type - can be added via JS */
.modal-header .modal-title i {
    color: var(--electric-lime, #06C506);
}

.modal-body {
    padding: 24px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--secondary-text-color, #666666);
    text-align: center;
}

.modal-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    justify-content: center;
    gap: 12px;
}

.modal-footer button {
    margin: 0;
    background: linear-gradient(135deg, var(--sapphire-blue, #0066CC), var(--electric-lime, #06C506));
    border: none;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    color: white;
    min-width: 120px;
    box-shadow: 0 4px 10px rgba(6, 197, 6, 0.2);
}

.modal-footer button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(6, 197, 6, 0.3);
}

.modal-footer .btn-secondary {
    background: transparent;
    color: var(--text-color, #000000);
    border: 2px solid var(--border-color, #e0e0e0);
    box-shadow: none;
}

.modal-footer .btn-secondary:hover {
    border-color: var(--electric-lime, #06C506);
    color: var(--electric-lime, #06C506);
    background: rgba(6, 197, 6, 0.05);
    transform: translateY(-2px);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes alertSlideDown {
    0% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   DARK THEME ADJUSTMENTS
   ============================================ */
[data-theme="dark"] .alert-container {
    background: var(--dark-surface, #0f0e0e);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .alert-container h4 {
    color: var(--primary-text-dark, #ffffff);
}

[data-theme="dark"] .alert-container p {
    color: var(--secondary-text, #CCCCCC);
}

[data-theme="dark"] .modal-content {
    background: var(--dark-surface, #0f0e0e);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-header .modal-title {
    color: var(--primary-text-dark, #ffffff);
}

[data-theme="dark"] .modal-body {
    color: var(--secondary-text, #CCCCCC);
}

[data-theme="dark"] .modal-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-footer .btn-secondary {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--primary-text-dark, #ffffff);
}

[data-theme="dark"] .modal-footer .btn-secondary:hover {
    border-color: var(--electric-lime, #06C506);
    color: var(--electric-lime, #06C506);
    background: rgba(6, 197, 6, 0.1);
}

[data-theme="dark"] .authx-alert {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .authx-alert-title {
    color: var(--primary-text-dark, #ffffff);
}

[data-theme="dark"] .authx-alert-message {
    color: var(--secondary-text, #CCCCCC);
}

[data-theme="dark"] .authx-alert-close {
    color: var(--secondary-text, #CCCCCC);
}

[data-theme="dark"] .authx-alert-close:hover {
    color: var(--primary-text-dark, #ffffff);
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .authx-alert-success {
    background: rgba(6, 197, 6, 0.15);
}

[data-theme="dark"] .authx-alert-error {
    background: rgba(244, 67, 54, 0.15);
}

[data-theme="dark"] .authx-alert-warning {
    background: rgba(255, 152, 0, 0.15);
}

[data-theme="dark"] .authx-alert-info {
    background: rgba(0, 102, 204, 0.15);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 576px) {
    .alert-container {
        width: 90%;
        top: 80px;
    }
    
    .alert-container > div {
        padding: 20px;
    }
    
    .alert-container h4 {
        font-size: 1.1rem;
    }
    
    .alert-container p {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }
    
    .alert-close-button {
        padding: 8px 24px;
        font-size: 0.9rem;
    }
    
    .modal-content {
        margin: 0 16px;
    }
    
    .modal-header {
        padding: 20px 20px 12px;
    }
    
    .modal-header .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 20px;
        font-size: 0.95rem;
    }
    
    .modal-footer {
        padding: 12px 20px 20px;
    }
    
    .modal-footer button {
        padding: 10px 24px;
        font-size: 0.95rem;
    }
}

@media (max-width: 375px) {
    .alert-container {
        top: 60px;
    }
    
    .alert-container > div {
        padding: 16px;
    }
    
    .alert-container h4 {
        font-size: 1rem;
    }
    
    .alert-container p {
        font-size: 0.85rem;
    }
    
    .alert-close-button {
        padding: 8px 20px;
        font-size: 0.85rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.alert-container ul {
    display: none;
}

/* Ensure compatibility with existing code */
.notification-container {
    position: relative;
    width: 100%;
}