.tooltip {
    position: relative;
    /* cursor: pointer; - Removed to respect underlying element's cursor */
}

/* Tooltip Body */
.tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    
    background-color: #1f2937; /* Gray-800 */
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 9999999999;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Tooltip Arrow */
.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    
    border-width: 6px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
    
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 9999999999;
}

/* Hover State */
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px); /* Slight lift effect */
}

.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* --- Responsive Positioning Modifiers --- */

/* Left-aligned (for elements near right edge) */
.tooltip.tooltip-left::after {
    left: auto;
    right: 0;
    transform: translateY(-8px); /* Remove X centering */
}
.tooltip.tooltip-left::before {
    left: auto;
    right: 12px; /* Roughly centered on icon size */
    transform: translateY(-2px);
}
.tooltip.tooltip-left:hover::after {
    transform: translateY(-10px);
}
.tooltip.tooltip-left:hover::before {
    transform: translateY(-4px);
}

/* Right-aligned (for elements near left edge) */
.tooltip.tooltip-right::after {
    left: 0;
    transform: translateY(-8px); /* Remove X centering */
}
.tooltip.tooltip-right::before {
    left: 12px; /* Roughly centered on icon size */
    transform: translateY(-2px);
}
.tooltip.tooltip-right:hover::after {
    transform: translateY(-10px);
}
.tooltip.tooltip-right:hover::before {
    transform: translateY(-4px);
}

/* Bottom-aligned (for elements near top edge) */
.tooltip.tooltip-bottom::after {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(8px);
}
.tooltip.tooltip-bottom::before {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(2px);
    border-color: transparent transparent #1f2937 transparent; /* Flip arrow color */
}
.tooltip.tooltip-bottom:hover::after {
    transform: translateX(-50%) translateY(10px);
}
.tooltip.tooltip-bottom:hover::before {
    transform: translateX(-50%) translateY(4px);
}

/* Combinations (e.g. Bottom-Left) */
.tooltip.tooltip-bottom.tooltip-left::after {
    left: auto;
    right: 0;
    transform: translateY(8px);
}
.tooltip.tooltip-bottom.tooltip-left::before {
    left: auto;
    right: 12px;
    transform: translateY(2px);
}
.tooltip.tooltip-bottom.tooltip-left:hover::after {
    transform: translateY(10px);
}
.tooltip.tooltip-bottom.tooltip-left:hover::before {
    transform: translateY(4px);
}

.tooltip.tooltip-bottom.tooltip-right::after {
    left: 0;
    transform: translateY(8px);
}
.tooltip.tooltip-bottom.tooltip-right::before {
    left: 12px;
    transform: translateY(2px);
}
.tooltip.tooltip-bottom.tooltip-right:hover::after {
    transform: translateY(10px);
}
.tooltip.tooltip-bottom.tooltip-right:hover::before {
    transform: translateY(4px);
}

/* ===================================
   SKELETON LOADING STYLES
   =================================== */

/* Shimmer animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Base skeleton class */
.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #f8f8f8 50%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
    border-radius: 4px;
}

/* Dark mode skeleton */
.dark .skeleton {
    background: linear-gradient(
        90deg,
        #1f2937 0%,
        #374151 50%,
        #1f2937 100%
    );
    background-size: 1000px 100%;
}

/* Skeleton variants */
.skeleton-text {
    height: 1em;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-card {
    height: 120px;
    width: 100%;
    border-radius: 0.75rem;
}

.skeleton-circle {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.skeleton-avatar {
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.skeleton-button {
    height: 40px;
    width: 100px;
    border-radius: 0.5rem;
}

.skeleton-input {
    height: 42px;
    width: 100%;
    border-radius: 0.375rem;
}

/* ===================================
   SWEETALERT2 TOAST CUSTOMIZATION
   Modern, Clean, Compact Design
   =================================== */

/* Toast container positioning */
.swal2-container.swal2-top-end {
    top: 1rem !important;
    right: 0.1rem !important;
}

/* Main toast wrapper */
.swal2-container .swal2-toast {
    min-height: auto !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0.1rem !important; /* Reduced from 0.75rem */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    min-width: 280px !important;
    max-width: 400px !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Success toast */
.swal2-toast.swal2-show.swal2-icon-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    color: white !important;
}

/* Error toast */
.swal2-toast.swal2-show.swal2-icon-error {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%) !important;
    color: white !important;
}

/* Warning toast */
.swal2-toast.swal2-show.swal2-icon-warning {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
    color: white !important;
}

/* Info toast */
.swal2-toast.swal2-show.swal2-icon-info {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
    color: white !important;
}

/* Icon styling structure - Simplified to avoid overlapping artifacts */
.swal2-toast .swal2-icon {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    margin: 0 12px 0 0 !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important; /* Removed specific background to reduce visual clutter */
}

/* Hide internal lines and rings for a cleaner "icon-only" look, 
   or ensure they fit perfectly. SweetAlert icons are complex. 
   Here we reset some internal styles to prevent the "overlapping" visual. 
*/
.swal2-toast .swal2-icon-content {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* =================================================================
   COMPLETE ICON REPLACEMENT - CLEAN & SIMPLE
   Hiding all complex SweetAlert inner structures and using ::before
   ================================================================= */

/* Hide all default internal icon elements */
.swal2-toast .swal2-icon-content,
.swal2-toast .swal2-success-ring, 
.swal2-toast .swal2-success-fix,
.swal2-toast .swal2-success-circular-line-left,
.swal2-toast .swal2-success-circular-line-right,
.swal2-toast .swal2-success-line-tip,
.swal2-toast .swal2-success-line-long,
.swal2-toast .swal2-x-mark-line-left,
.swal2-toast .swal2-x-mark-line-right,
.swal2-toast .swal2-icon-text {
    display: none !important;
}

/* Reset base icon styles */
.swal2-toast .swal2-icon {
    border: none !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    margin: 0 12px 0 0 !important;
}

/* SUCCESS: Clean Tick */
.swal2-toast .swal2-icon.swal2-success::before {
    content: '';
    display: block;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* ERROR: Clean X */
.swal2-toast .swal2-icon.swal2-error::before {
    content: '×';
    color: white;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    margin-top: -2px;
    font-family: Arial, sans-serif;
}

/* WARNING: Clean ! */
.swal2-toast .swal2-icon.swal2-warning::before {
    content: '!';
    color: white;
    font-size: 14px;
    font-weight: 700;
    font-family: Arial, sans-serif;
}

/* INFO: Clean i */
.swal2-toast .swal2-icon.swal2-info::before {
    content: 'i';
    color: white;
    font-size: 14px;
    font-weight: 700;
    font-family: serif; /* Serif 'i' usually looks better */
}


.swal2-toast .swal2-success .swal2-success-circular-line-left,
.swal2-toast .swal2-success .swal2-success-circular-line-right {
    background: transparent !important;
}

/* Error X */
.swal2-toast .swal2-error [class^='swal2-x-mark-line'] {
    background-color: white !important;
    height: 2px !important;
}

/* Title styling */
.swal2-toast .swal2-title {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
    color: white !important;
    flex-grow: 1 !important;
}

/* HTML container */
.swal2-toast .swal2-html-container {
    font-size: 0.75rem !important;
    margin: 0.25rem 0 0 0 !important;
    padding: 0 !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Progress bar */
.swal2-toast .swal2-timer-progress-bar {
    height: 3px !important;
    background: rgba(255, 255, 255, 0.3) !important;
    border-radius: 0 0 0.75rem 0.75rem !important;
}

/* Close button */
.swal2-toast .swal2-close {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 1.25rem !important;
    line-height: 1 !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    margin: 0 0 0 0.5rem !important;
    padding: 0 !important;
    opacity: 0.8 !important;
    transition: opacity 0.2s !important;
}

.swal2-toast .swal2-close:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 0.375rem !important;
}

/* Smooth animations */
.swal2-toast.swal2-show {
    animation: slideInRight 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
}

.swal2-toast.swal2-hide {
    animation: slideOutRight 0.2s ease-in !important;
}

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

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

/* Dark mode adjustments */
.dark .swal2-toast {
    border-color: rgba(255, 255, 255, 0.1) !important;
}
