/*
 * Modern UI Components Enhancement
 * Loading states, notifications, tooltips, and animations
 */

/* ========================================
   Enhanced SweetAlert Modal Styling
   ======================================== */
.swal-modal {
    border-radius: 20px !important;
    padding: 30px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2) !important;
}

.swal-title {
    font-family: 'Poppins', sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 16px !important;
}

.swal-text {
    font-family: 'Poppins', sans-serif !important;
    font-size: 15px !important;
    color: #64748b !important;
    line-height: 1.6 !important;
}

.swal-button {
    border-radius: 10px !important;
    padding: 12px 28px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.swal-button:not([disabled]):hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

.swal-button--confirm {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
}

.swal-button--cancel {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.swal-icon--success {
    border-color: #10b981 !important;
}

.swal-icon--success__ring {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.swal-icon--success__line {
    background-color: #10b981 !important;
}

.swal-icon--error {
    border-color: #ef4444 !important;
}

.swal-icon--error__line {
    background-color: #ef4444 !important;
}

.swal-icon--warning {
    border-color: #f59e0b !important;
}

.swal-icon--warning__body,
.swal-icon--warning__dot {
    background-color: #f59e0b !important;
}

/* ========================================
   Enhanced Loading Spinner
   ======================================== */
.preloader {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.loader-container {
    text-align: center;
}

.cssload-speeding-wheel {
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top: 5px solid #ffffff;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modern Loading Dots */
.loading-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========================================
   Skeleton Loading
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    height: 120px;
    width: 100%;
}

/* ========================================
   Enhanced Notifications/Toasts
   ======================================== */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-notification.toast-success {
    border-left: 4px solid #10b981;
}

.toast-notification.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-notification.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-notification.toast-info {
    border-left: 4px solid #06b6d4;
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #10b981;
}

.toast-error .toast-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #ef4444;
}

.toast-warning .toast-icon {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #f59e0b;
}

.toast-info .toast-icon {
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
    color: #06b6d4;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    font-size: 14px;
}

.toast-message {
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: #475569;
}

/* ========================================
   Enhanced Tooltips
   ======================================== */
.tooltip-modern {
    position: relative;
    cursor: help;
}

.tooltip-modern::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #1e293b;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.tooltip-modern::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.tooltip-modern:hover::before,
.tooltip-modern:hover::after {
    opacity: 1;
}

/* ========================================
   Status Indicators
   ======================================== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.status-active {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.status-active::before {
    background: #10b981;
}

.status-pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #78350f;
}

.status-pending::before {
    background: #f59e0b;
}

.status-inactive {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #7f1d1d;
}

.status-inactive::before {
    background: #ef4444;
}

/* ========================================
   Action Icons/Buttons
   ======================================== */
.icon-button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    background: #f1f5f9;
    color: #64748b;
}

.icon-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.icon-button.icon-edit {
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    color: #6366f1;
}

.icon-button.icon-edit:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.icon-button.icon-delete {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #ef4444;
}

.icon-button.icon-delete:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.icon-button.icon-view {
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
    color: #06b6d4;
}

.icon-button.icon-view:hover {
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #94a3b8;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.empty-state-message {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
}

/* ========================================
   Data Loading Placeholder
   ======================================== */
.data-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
}

.data-loading-text {
    color: #64748b;
    font-weight: 500;
}

/* ========================================
   File Upload Zone
   ======================================== */
.file-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8fafc;
}

.file-upload-zone:hover {
    border-color: #6366f1;
    background: linear-gradient(135deg, #f0f1ff 0%, #f8f9ff 100%);
}

.file-upload-zone.dragover {
    border-color: #6366f1;
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    transform: scale(1.02);
}

.file-upload-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #6366f1;
}

.file-upload-text {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.file-upload-hint {
    font-size: 13px;
    color: #64748b;
}

/* ========================================
   Search Bar Enhancement
   ======================================== */
.search-bar {
    position: relative;
}

.search-bar input {
    padding-left: 45px;
    padding-right: 45px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-bar-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
}

.search-bar-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    display: none;
}

.search-bar input:not(:placeholder-shown) ~ .search-bar-clear {
    display: block;
}

.search-bar-clear:hover {
    color: #475569;
}

/* ========================================
   Timeline Component
   ======================================== */
.timeline-modern {
    position: relative;
    padding-left: 40px;
}

.timeline-modern::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #6366f1, #8b5cf6, transparent);
}

.timeline-item {
    position: relative;
    padding-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6366f1;
    box-shadow: 0 0 0 4px #ffffff, 0 0 0 6px rgba(99, 102, 241, 0.2);
}

.timeline-content {
    background: #ffffff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.timeline-time {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 8px;
}

.timeline-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.timeline-description {
    font-size: 13px;
    color: #64748b;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .toast-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
    
    .file-upload-zone {
        padding: 30px 20px;
    }
    
    .empty-state {
        padding: 40px 15px;
    }
}

