/**
 * GEONESEMS - Enhanced Notifications & UI Components
 * Modern, accessible notification system with animations
 */

/* Notification Container */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

/* Notification Card */
.notification {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 320px;
    pointer-events: all;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Notification Animations */
.notification-enter {
    transform: translateX(400px);
    opacity: 0;
}

.notification-active {
    transform: translateX(0);
    opacity: 1;
}

.notification-exit {
    transform: translateX(400px);
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin: 0;
}

/* Notification Types */
.notification-success {
    border-left: 4px solid #28a745;
}

.notification-success .notification-icon {
    color: #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-error .notification-icon {
    color: #dc3545;
}

.notification-warning {
    border-left: 4px solid #ffc107;
}

.notification-warning .notification-icon {
    color: #ffc107;
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

.notification-info .notification-icon {
    color: #17a2b8;
}

.notification-loading {
    border-left: 4px solid #667eea;
}

.notification-loading .notification-icon {
    color: #667eea;
}

/* Notification Icon */
.notification-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Notification Content */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    word-wrap: break-word;
}

/* Notification Action Button */
.notification-action {
    background: transparent;
    border: 1px solid #667eea;
    color: #667eea;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
}

.notification-action:hover {
    background: #667eea;
    color: white;
}

/* Notification Close Button */
.notification-close {
    background: transparent;
    border: none;
    color: #999;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

/* Notification Progress Bar */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 100%;
    transition: width linear;
}

.notification-success .notification-progress {
    background: #28a745;
}

.notification-error .notification-progress {
    background: #dc3545;
}

.notification-warning .notification-progress {
    background: #ffc107;
}

.notification-info .notification-progress {
    background: #17a2b8;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
}

.loading-overlay.active {
    opacity: 1;
}

.loading-spinner {
    background: white;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-spinner p {
    color: #333;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

/* Confirm Dialog */
.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s;
}

.confirm-dialog-overlay.active {
    opacity: 1;
}

.confirm-dialog-overlay.active .confirm-dialog {
    transform: scale(1);
}

.confirm-dialog {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-dialog-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #eee;
}

.confirm-dialog-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.confirm-dialog-body {
    padding: 24px;
}

.confirm-dialog-body p {
    margin: 0;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

.confirm-dialog-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Form Field Errors */
.input-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

.field-error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: slideDown 0.3s ease-out;
}

.field-error::before {
    content: '⚠️';
    font-size: 14px;
}

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

/* Password Strength Indicator */
.password-strength-container {
    margin-top: 8px;
}

.password-strength-bar {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.password-strength-fill {
    height: 100%;
    transition: all 0.3s;
    border-radius: 2px;
}

.password-strength-fill.weak {
    width: 33%;
    background: #dc3545;
}

.password-strength-fill.medium {
    width: 66%;
    background: #ffc107;
}

.password-strength-fill.strong {
    width: 100%;
    background: #28a745;
}

.password-strength-text {
    font-size: 12px;
    color: #666;
}

/* Enhanced Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover:not(:disabled) {
    background: #e9ecef;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

/* Badge Component */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Alert Component */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .notification-container {
        left: 20px;
        right: 20px;
        top: 10px;
        max-width: none;
    }
    
    .notification {
        min-width: auto;
        width: 100%;
    }
    
    .notification-enter {
        transform: translateY(-100px);
    }
    
    .notification-exit {
        transform: translateY(-100px);
    }
    
    .confirm-dialog {
        width: 95%;
    }
    
    .loading-spinner {
        padding: 30px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .notification,
    .loading-overlay,
    .confirm-dialog-overlay,
    .btn {
        transition: none;
    }
    
    .spinner {
        animation: none;
        border-top-color: #667eea;
    }
}

/* Focus States */
.notification-close:focus,
.notification-action:focus,
.btn:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .notification {
        background: #2d3748;
        color: #e2e8f0;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
    
    .notification-message {
        color: #e2e8f0;
    }
    
    .notification-close {
        color: #a0aec0;
    }
    
    .notification-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #e2e8f0;
    }
    
    .loading-spinner,
    .confirm-dialog {
        background: #2d3748;
    }
    
    .loading-spinner p,
    .confirm-dialog-header h3 {
        color: #e2e8f0;
    }
    
    .confirm-dialog-body p {
        color: #cbd5e0;
    }
    
    .confirm-dialog-header {
        border-bottom-color: #4a5568;
    }
}
