/* SVG Stat Icons - Reliable cross-platform solution */
.stat-icon-svg {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
    background: rgba(59, 130, 246, 0.1) !important;
}

.stat-icon-svg:hover {
    transform: scale(1.05);
    background: rgba(59, 130, 246, 0.15) !important;
}

.stat-icon-svg svg {
    width: 48px !important;
    height: 48px !important;
}

/* Specific icon background colors */
.stat-icon-svg.patients {
    background: rgba(59, 130, 246, 0.1) !important; /* Blue */
}

.stat-icon-svg.consultation {
    background: rgba(245, 158, 11, 0.1) !important; /* Amber */
}

.stat-icon-svg.staff {
    background: rgba(16, 185, 129, 0.1) !important; /* Emerald */
}

.stat-icon-svg.rooms {
    background: rgba(239, 68, 68, 0.1) !important; /* Red */
}

/* Small versions for buttons */
.stat-icon-svg.small {
    width: 24px !important;
    height: 24px !important;
    background: transparent !important;
}

.stat-icon-svg.small svg {
    width: 20px !important;
    height: 20px !important;
}

/* Button variants */
.stat-icon-svg.search, 
.stat-icon-svg.notification {
    width: 32px !important;
    height: 32px !important;
    background: transparent !important;
    border-radius: 6px !important;
}

.stat-icon-svg.search svg,
.stat-icon-svg.notification svg {
    width: 24px !important;
    height: 24px !important;
}

.stat-icon-svg.search:hover,
.stat-icon-svg.notification:hover {
    background: rgba(107, 114, 128, 0.1) !important;
}

/* Font Awesome Icons - Enhanced Styling */
.stat-icon-fa {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
    background: rgba(59, 130, 246, 0.1) !important;
    cursor: pointer;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.stat-icon-fa:hover {
    transform: scale(1.05);
    background: rgba(59, 130, 246, 0.15) !important;
}

.stat-icon-fa i {
    font-size: 28px !important;
    color: #3B82F6 !important;
    transition: all 0.2s ease !important;
}

/* FontAwesome Fallback System */
.stat-icon-fa i[data-fallback] {
    position: relative;
}

/* When FontAwesome fails, show emoji fallback */
.fontawesome-failed .stat-icon-fa i:before {
    content: attr(data-fallback) !important;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", "Segoe UI Symbol", sans-serif !important;
    font-size: 28px !important;
    line-height: 1 !important;
}

/* Hide FontAwesome icon when using fallback */
.fontawesome-failed .stat-icon-fa i {
    font-family: inherit !important;
}

/* Ensure emoji fallbacks are properly sized and positioned */
.fontawesome-failed .stat-icon-fa i[data-fallback] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

/* Additional fallback styling for better appearance */
.fontawesome-failed .stat-icon-fa i {
    font-size: 0 !important;
    line-height: 0 !important;
}

.fontawesome-failed .stat-icon-fa i:before {
    font-size: 28px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

/* Ensure emojis are properly centered in all contexts */
.fontawesome-failed .stat-icon-fa {
    position: relative;
}

.fontawesome-failed .stat-icon-fa i:before {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Specific icon background colors and styles */
.stat-icon-fa.patients {
    background: rgba(59, 130, 246, 0.1) !important;
}

.stat-icon-fa.patients i {
    color: #3B82F6 !important;
}

.stat-icon-fa.consultation {
    background: rgba(245, 158, 11, 0.1) !important;
}

.stat-icon-fa.consultation i {
    color: #F59E0B !important;
}

.stat-icon-fa.staff {
    background: rgba(16, 185, 129, 0.1) !important;
}

.stat-icon-fa.staff i {
    color: #10B981 !important;
}

.stat-icon-fa.rooms {
    background: rgba(239, 68, 68, 0.1) !important;
}

.stat-icon-fa.rooms i {
    color: #EF4444 !important;
}

/* Patients page specific icon colors */
.stat-icon-fa.total {
    background: rgba(59, 130, 246, 0.1) !important;
}

.stat-icon-fa.total i {
    color: #3B82F6 !important;
}

.stat-icon-fa.active {
    background: rgba(16, 185, 129, 0.1) !important;
}

.stat-icon-fa.active i {
    color: #10B981 !important;
}

.stat-icon-fa.new {
    background: rgba(245, 158, 11, 0.1) !important;
}

.stat-icon-fa.new i {
    color: #F59E0B !important;
}

.stat-icon-fa.appointments {
    background: rgba(139, 92, 246, 0.1) !important;
}

.stat-icon-fa.appointments i {
    color: #8B5CF6 !important;
}

/* Small Font Awesome icons for buttons and inline use */
.stat-icon-fa.small {
    width: 24px !important;
    height: 24px !important;
    background: transparent !important;
    border-radius: 4px !important;
    cursor: pointer;
}

.stat-icon-fa.small i {
    font-size: 16px !important;
    color: #6B7280 !important;
}

.stat-icon-fa.small:hover {
    background: rgba(107, 114, 128, 0.1) !important;
    transform: none;
}

.stat-icon-fa.small:hover i {
    color: #374151 !important;
}

/* Title icons in headers */
.stat-icon-fa.title-icon {
    width: 32px !important;
    height: 32px !important;
    background: transparent !important;
    margin-right: 8px !important;
}

.stat-icon-fa.title-icon i {
    font-size: 24px !important;
    color: #1F2937 !important;
}

/* Button icons */
.stat-icon-fa.btn-icon {
    width: 20px !important;
    height: 20px !important;
    background: transparent !important;
    margin-right: 6px !important;
}

.stat-icon-fa.btn-icon i {
    font-size: 14px !important;
    color: inherit !important;
}

/* Search and filter icons */
.stat-icon-fa.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px !important;
    height: 20px !important;
    background: transparent !important;
}

.stat-icon-fa.search-icon i {
    font-size: 16px !important;
    color: #9CA3AF !important;
}

/* Clear search button */
.stat-icon-fa.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px !important;
    height: 20px !important;
    background: transparent !important;
    cursor: pointer;
}

.stat-icon-fa.clear-search:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    border-radius: 50% !important;
}

.stat-icon-fa.clear-search i {
    font-size: 14px !important;
    color: #9CA3AF !important;
}

.stat-icon-fa.clear-search:hover i {
    color: #EF4444 !important;
}

/* View toggle icons */
.stat-icon-fa.view-icon {
    width: 18px !important;
    height: 18px !important;
    background: transparent !important;
    margin-right: 6px !important;
}

.stat-icon-fa.view-icon i {
    font-size: 14px !important;
    color: inherit !important;
}

/* Detail icons in patient cards */
.stat-icon-fa.detail-icon {
    width: 16px !important;
    height: 16px !important;
    background: transparent !important;
    margin-right: 4px !important;
}

.stat-icon-fa.detail-icon i {
    font-size: 12px !important;
    color: #6B7280 !important;
}

/* Action icons */
.stat-icon-fa.action-icon {
    width: 20px !important;
    height: 20px !important;
    background: transparent !important;
}

.stat-icon-fa.action-icon i {
    font-size: 14px !important;
    color: #6B7280 !important;
}

/* No results icon */
.stat-icon-fa.no-results-icon {
    width: 64px !important;
    height: 64px !important;
    background: rgba(156, 163, 175, 0.1) !important;
    margin: 0 auto 16px auto !important;
}

.stat-icon-fa.no-results-icon i {
    font-size: 32px !important;
    color: #9CA3AF !important;
}

/* Navigation icons */
.stat-icon-fa.nav-icon {
    width: 16px !important;
    height: 16px !important;
    background: transparent !important;
    margin: 0 4px !important;
}

.stat-icon-fa.nav-icon i {
    font-size: 12px !important;
    color: inherit !important;
}

/* Close icon in modals */
.stat-icon-fa.close-icon {
    width: 20px !important;
    height: 20px !important;
    background: transparent !important;
}

.stat-icon-fa.close-icon i {
    font-size: 16px !important;
    color: #9CA3AF !important;
}

.stat-icon-fa.close-icon:hover i {
    color: #EF4444 !important;
}

/* Navigation buttons specific styling */
.stat-icon-fa.nav-btn {
    width: 32px !important;
    height: 32px !important;
    background: #F3F4F6 !important;
    border-radius: 6px !important;
    border: 1px solid #E5E7EB !important;
}

.stat-icon-fa.nav-btn:hover {
    background: #E5E7EB !important;
    border-color: #D1D5DB !important;
}

.stat-icon-fa.nav-btn i {
    font-size: 14px !important;
    color: #374151 !important;
}

/* Payment, balance, and action icons */
.stat-icon-fa.payment-icon,
.stat-icon-fa.balance-icon,
.stat-icon-fa.balance-chart {
    width: 32px !important;
    height: 32px !important;
    background: transparent !important;
}

.stat-icon-fa.payment-icon i,
.stat-icon-fa.balance-icon i {
    color: #059669 !important;
    font-size: 18px !important;
}

.stat-icon-fa.balance-chart i {
    color: #DC2626 !important;
    font-size: 16px !important;
}

/* Menu buttons */
.stat-icon-fa.payment-menu,
.stat-icon-fa.doctor-menu,
.stat-icon-fa.menu-btn {
    width: 24px !important;
    height: 24px !important;
    background: transparent !important;
}

.stat-icon-fa.payment-menu:hover,
.stat-icon-fa.doctor-menu:hover,
.stat-icon-fa.menu-btn:hover {
    background: rgba(107, 114, 128, 0.1) !important;
}

/* Call button */
.stat-icon-fa.call-btn {
    width: 32px !important;
    height: 32px !important;
    background: rgba(16, 185, 129, 0.1) !important;
    border-radius: 6px !important;
}

.stat-icon-fa.call-btn i {
    color: #10B981 !important;
    font-size: 16px !important;
}

.stat-icon-fa.call-btn:hover {
    background: rgba(16, 185, 129, 0.2) !important;
}

/* Search bar and notification specific styling */
.search-container .stat-icon-fa {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px !important;
    height: 24px !important;
    background: transparent !important;
    cursor: pointer;
}

.search-container .stat-icon-fa i {
    font-size: 16px !important;
    color: #6B7280 !important;
}

.search-container .stat-icon-fa:hover i {
    color: #374151 !important;
}

.header-btn .stat-icon-fa {
    width: 24px !important;
    height: 24px !important;
    background: transparent !important;
}

.header-btn .stat-icon-fa i {
    font-size: 18px !important;
    color: #6B7280 !important;
}

.header-btn:hover .stat-icon-fa i {
    color: #4F46E5 !important;
}

/* Button-specific FontAwesome icon styling */
button .stat-icon-fa {
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    border-radius: 0 !important;
}

button .stat-icon-fa:hover {
    transform: none !important;
    background: transparent !important;
}

button .stat-icon-fa i {
    font-size: inherit !important;
    color: inherit !important;
}

/* Search button specific styling */
.search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.search-btn:hover {
    background: rgba(107, 114, 128, 0.1);
}

.search-btn .stat-icon-fa i {
    color: #6B7280;
    font-size: 16px;
}

.search-btn:hover .stat-icon-fa i {
    color: #374151;
}

/* Notification button styling */
.notification-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    position: relative;
    transition: background-color 0.2s ease;
}

.notification-btn:hover {
    background: rgba(107, 114, 128, 0.1);
}

.notification-btn .stat-icon-fa i {
    color: #6B7280;
    font-size: 18px;
}

.notification-btn:hover .stat-icon-fa i {
    color: #4F46E5;
}

/* Nav button styling */
.nav-btn {
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: #E5E7EB;
    border-color: #D1D5DB;
}

.nav-btn .stat-icon-fa i {
    color: #374151;
    font-size: 14px;
}

/* Payment and menu button styling */
.payment-menu, .doctor-menu, .menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-menu:hover, .doctor-menu:hover, .menu-btn:hover {
    background: rgba(107, 114, 128, 0.1);
}

.payment-menu .stat-icon-fa i, 
.doctor-menu .stat-icon-fa i, 
.menu-btn .stat-icon-fa i {
    color: #6B7280;
    font-size: 14px;
}

.payment-menu:hover .stat-icon-fa i, 
.doctor-menu:hover .stat-icon-fa i, 
.menu-btn:hover .stat-icon-fa i {
    color: #374151;
}

/* Call button styling */
.call-btn {
    background: rgba(16, 185, 129, 0.1);
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-btn:hover {
    background: rgba(16, 185, 129, 0.2);
}

.call-btn .stat-icon-fa i {
    color: #10B981;
    font-size: 16px;
}

/* Image Icons */
.stat-icon-img {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
    background: rgba(59, 130, 246, 0.1) !important;
}

.stat-icon-img:hover {
    transform: scale(1.05);
    background: rgba(59, 130, 246, 0.15) !important;
}

.stat-icon-img img {
    width: 48px !important;
    height: 48px !important;
    object-fit: contain !important;
}

/* Responsive adjustments for FontAwesome icons */
@media (max-width: 768px) {
    .stat-icon-fa {
        width: 50px !important;
        height: 50px !important;
    }
    
    .stat-icon-fa i {
        font-size: 24px !important;
    }
    
    .stat-icon-fa.small {
        width: 20px !important;
        height: 20px !important;
    }
    
    .stat-icon-fa.small i {
        font-size: 14px !important;
    }
}

/* Search box positioning for Patients page */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box .stat-icon-fa.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.search-box .search-input {
    padding-left: 40px !important;
    padding-right: 40px !important;
}

.search-box .stat-icon-fa.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

/* Action buttons in patient cards */
.action-btn {
    background: transparent;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3B82F6;
}

.action-btn .stat-icon-fa i {
    color: #6B7280;
    font-size: 16px;
}

.action-btn:hover .stat-icon-fa i {
    color: #3B82F6;
}

/* Small action buttons in table view */
.action-btn-small {
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.action-btn-small:hover {
    background: rgba(59, 130, 246, 0.1);
}

.action-btn-small .stat-icon-fa i {
    color: #6B7280;
    font-size: 14px;
}

.action-btn-small:hover .stat-icon-fa i {
    color: #3B82F6;
}

/* Modal close button styling */
.modal-close {
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
}

.modal-close .stat-icon-fa i {
    color: #9CA3AF;
    font-size: 16px;
}

.modal-close:hover .stat-icon-fa i {
    color: #EF4444;
}

/* Pagination button styling */
.pagination-btn {
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #374151;
}

.pagination-btn:hover {
    background: #E5E7EB;
    border-color: #D1D5DB;
}

.pagination-btn.active {
    background: #3B82F6;
    border-color: #3B82F6;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn:disabled:hover {
    background: #F3F4F6;
    border-color: #E5E7EB;
}