/**
 * Inommo Design System - Utility Classes
 * Version: 1.0.0
 * 
 * This file contains utility classes for quick styling.
 * Includes: text colors, backgrounds, spacing helpers, animations, etc.
 */

/* ============================================
   TEXT COLORS - FUNCTIONAL
   ============================================ */
.text-groups {
    color: var(--color-groups-primary) !important;
}

.text-projects,
.text-activities,
.text-tasks {
    color: var(--color-projects-primary) !important;
}

.text-messages {
    color: var(--color-messages-primary) !important;
}

.text-finance {
    color: var(--color-finance-primary) !important;
}

/* ============================================
   BACKGROUND COLORS - FUNCTIONAL
   ============================================ */
.bg-groups-light {
    background-color: var(--color-groups-light) !important;
}

.bg-projects-light,
.bg-activities-light,
.bg-tasks-light {
    background-color: var(--color-projects-light) !important;
}

.bg-messages-light {
    background-color: var(--color-messages-light) !important;
}

.bg-finance-light {
    background-color: var(--color-finance-light) !important;
}

/* ============================================
   BORDER COLORS - FUNCTIONAL
   ============================================ */
.border-groups {
    border-color: var(--color-groups-primary) !important;
}

.border-projects,
.border-activities,
.border-tasks {
    border-color: var(--color-projects-primary) !important;
}

.border-messages {
    border-color: var(--color-messages-primary) !important;
}

.border-finance {
    border-color: var(--color-finance-primary) !important;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: transform var(--transition-fast);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow-groups:hover {
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.4);
}

.hover-glow-projects:hover,
.hover-glow-activities:hover,
.hover-glow-tasks:hover {
    box-shadow: 0 0 20px rgba(13, 110, 253, 0.4);
}

.hover-glow-messages:hover {
    box-shadow: 0 0 20px rgba(111, 66, 193, 0.4);
}

.hover-glow-finance:hover {
    box-shadow: 0 0 20px rgba(253, 126, 20, 0.4);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-base) ease-out;
}

.animate-slide-in {
    animation: slideInRight var(--transition-base) ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Stagger animations for lists */
.stagger-animation>* {
    animation: fadeIn var(--transition-base) ease-out;
}

.stagger-animation>*:nth-child(1) {
    animation-delay: 0ms;
}

.stagger-animation>*:nth-child(2) {
    animation-delay: 100ms;
}

.stagger-animation>*:nth-child(3) {
    animation-delay: 200ms;
}

.stagger-animation>*:nth-child(4) {
    animation-delay: 300ms;
}

.stagger-animation>*:nth-child(5) {
    animation-delay: 400ms;
}

/* ============================================
   SPACING UTILITIES
   ============================================ */
.gap-xs {
    gap: var(--spacing-xs);
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

.gap-xl {
    gap: var(--spacing-xl);
}

/* ============================================
   BORDER RADIUS UTILITIES
   ============================================ */
.rounded-sm {
    border-radius: var(--radius-sm) !important;
}

.rounded-md {
    border-radius: var(--radius-md) !important;
}

.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}

.rounded-2xl {
    border-radius: var(--radius-2xl) !important;
}

/* ============================================
   SHADOW UTILITIES
   ============================================ */
.shadow-xs {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.shadow-xl {
    box-shadow: var(--shadow-xl) !important;
}

.shadow-2xl {
    box-shadow: var(--shadow-2xl) !important;
}

/* ============================================
   GRADIENT BACKGROUNDS
   ============================================ */
.gradient-groups {
    background: linear-gradient(135deg, var(--color-groups-primary) 0%, var(--color-groups-dark) 100%);
    color: white;
}

.gradient-projects,
.gradient-activities,
.gradient-tasks {
    background: linear-gradient(135deg, var(--color-projects-primary) 0%, var(--color-projects-dark) 100%);
    color: white;
}

.gradient-messages {
    background: linear-gradient(135deg, var(--color-messages-primary) 0%, var(--color-messages-dark) 100%);
    color: white;
}

.gradient-finance {
    background: linear-gradient(135deg, var(--color-finance-primary) 0%, var(--color-finance-dark) 100%);
    color: white;
}

/* ============================================
   ICON SIZES
   ============================================ */
.icon-xs {
    font-size: 0.875rem;
}

.icon-sm {
    font-size: 1rem;
}

.icon-md {
    font-size: 1.25rem;
}

.icon-lg {
    font-size: 1.5rem;
}

.icon-xl {
    font-size: 2rem;
}

.icon-2xl {
    font-size: 2.5rem;
}

/* ============================================
   LOADING STATES
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

[data-bs-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
/* Hide on mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 1199px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 1200px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.sr-only-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-full);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-full);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   TRUNCATE TEXT
   ============================================ */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}