/**
 * AJAX Components Styles
 * 
 * Styles for:
 * - Toast notifications
 * - Loading spinners
 * - Confirmation modals
 * - Page loaders
 */

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.ajax-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    font-family: Arial, sans-serif;
}

.ajax-toast-show {
    transform: translateX(0);
}

.ajax-toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.ajax-toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

.ajax-toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ajax-toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Toast Types */
.ajax-toast-success {
    border-left: 4px solid #10b981;
}

.ajax-toast-success .ajax-toast-icon {
    background: #d1fae5;
    color: #10b981;
}

.ajax-toast-error {
    border-left: 4px solid #ef4444;
}

.ajax-toast-error .ajax-toast-icon {
    background: #fee2e2;
    color: #ef4444;
}

.ajax-toast-warning {
    border-left: 4px solid #f59e0b;
}

.ajax-toast-warning .ajax-toast-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.ajax-toast-info {
    border-left: 4px solid #3b82f6;
}

.ajax-toast-info .ajax-toast-icon {
    background: #dbeafe;
    color: #3b82f6;
}

/* ============================================
   LOADING SPINNERS
   ============================================ */

.ajax-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: ajax-spin 0.6s linear infinite;
}

@keyframes ajax-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Page Loader */
.ajax-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.ajax-page-loader-show {
    opacity: 1;
    visibility: visible;
}

.ajax-page-loader-content {
    background: white;
    border-radius: 12px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.ajax-page-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #0C5B3F;
    border-radius: 50%;
    animation: ajax-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.ajax-page-loader-content p {
    margin: 0;
    font-size: 16px;
    color: #374151;
    font-family: Arial, sans-serif;
}

/* ============================================
   CONFIRMATION MODAL
   ============================================ */

.ajax-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.ajax-confirm-modal-show {
    opacity: 1;
    visibility: visible;
}

.ajax-confirm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.ajax-confirm-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 480px;
    font-family: Arial, sans-serif;
}

.ajax-confirm-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.ajax-confirm-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.ajax-confirm-modal-body {
    padding: 20px 24px;
}

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

.ajax-confirm-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================
   BUTTONS
   ============================================ */

.ajax-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: Arial, sans-serif;
}

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

.ajax-btn-primary {
    background: #0C5B3F;
    color: white;
}

.ajax-btn-primary:hover:not(:disabled) {
    background: #0a4a32;
}

.ajax-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

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

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

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

.ajax-btn-warning {
    background: #f59e0b;
    color: white;
}

.ajax-btn-warning:hover:not(:disabled) {
    background: #d97706;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .ajax-toast {
        left: 20px;
        right: 20px;
        min-width: auto;
    }

    .ajax-confirm-modal-content {
        width: 95%;
    }

    .ajax-confirm-modal-footer {
        flex-direction: column-reverse;
    }

    .ajax-confirm-modal-footer .ajax-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   FADE IN/OUT ANIMATIONS
   ============================================ */

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

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

.ajax-fade-in {
    animation: ajax-fade-in 0.3s ease;
}

.ajax-fade-out {
    animation: ajax-fade-out 0.3s ease;
}
