/**
 * WhatsApp Marketing Tool - Enterprise SaaS Design System
 * Premium gradients, advanced animations, and motion design
 * Built on Bootstrap 5 + Argon UI
 */

/* ============================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    /* === Primary Color Palette === */
    --color-primary: #5e72e4;
    --color-primary-dark: #4c5dcc;
    --color-primary-light: #8392eb;
    --color-secondary: #8965e0;
    --color-accent: #11cdef;

    /* === Semantic Colors === */
    --color-success: #2dce89;
    --color-success-dark: #24a46d;
    --color-warning: #fb6340;
    --color-danger: #f5365c;
    --color-info: #11cdef;

    /* === Neutral Palette === */
    --color-dark: #172b4d;
    --color-muted: #8898aa;
    --color-light: #f6f9fc;
    --color-white: #ffffff;
    --color-body-bg: #f8f9fe;

    /* === Premium Gradients === */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-primary-hover: linear-gradient(135deg, #5a6fd6 0%, #6a4291 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-danger: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-warning: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-dark: linear-gradient(135deg, #434343 0%, #000000 100%);

    /* === Special Gradients === */
    --gradient-cosmic: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --gradient-ocean: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
    --gradient-sunset: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-aurora: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --gradient-midnight: linear-gradient(135deg, #232526 0%, #414345 100%);
    --gradient-royal: linear-gradient(135deg, #141e30 0%, #243b55 100%);

    /* === Animated Gradients === */
    --gradient-animated: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #11cdef);
    --gradient-shimmer: linear-gradient(90deg, #f6f9fc 25%, #e9ecef 50%, #f6f9fc 75%);

    /* === Sidebar Gradients === */
    --sidebar-gradient: linear-gradient(180deg, #5e72e4 0%, #825ee4 50%, #9d4edd 100%);
    --sidebar-gradient-dark: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);

    /* === Shadow System === */
    --shadow-xs: 0 1px 3px rgba(50, 50, 93, 0.08);
    --shadow-sm: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 16px rgba(50, 50, 93, 0.12), 0 3px 6px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 35px rgba(50, 50, 93, 0.15), 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px rgba(50, 50, 93, 0.2), 0 10px 20px rgba(0, 0, 0, 0.12);

    /* === Glow Shadows === */
    --glow-primary: 0 0 20px rgba(94, 114, 228, 0.4);
    --glow-success: 0 0 20px rgba(45, 206, 137, 0.4);
    --glow-danger: 0 0 20px rgba(245, 54, 92, 0.4);
    --glow-info: 0 0 20px rgba(17, 205, 239, 0.4);

    /* === Border Radius === */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* === Animation Timing === */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-in-out-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* === Animation Durations === */
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
    --duration-slower: 800ms;

    /* === Z-Index Scale === */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-modal: 1050;
    --z-tooltip: 1070;
    --z-toast: 1090;
}

/* ============================================
   2. GLOBAL ANIMATIONS & KEYFRAMES
   ============================================ */

/* === Page Load Animation === */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-enter {
    animation: pageEnter var(--duration-slow) var(--ease-out-expo) forwards;
}

/* === Fade Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === Scale Animations === */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* === Slide Animations === */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* === Continuous Animations === */
@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(94, 114, 228, 0.4);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(94, 114, 228, 0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* === Ripple Effect === */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* === Counter Animation === */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Shake Animation === */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* === Success Check Animation === */
@keyframes successCheck {
    0% {
        stroke-dashoffset: 100;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

/* ============================================
   3. ANIMATION UTILITY CLASSES
   ============================================ */

/* === Entrance Animations === */
.animate-fade-in {
    animation: fadeIn var(--duration-normal) var(--ease-out-expo) forwards;
}

.animate-fade-in-up {
    animation: fadeInUp var(--duration-normal) var(--ease-out-expo) forwards;
}

.animate-fade-in-down {
    animation: fadeInDown var(--duration-normal) var(--ease-out-expo) forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft var(--duration-normal) var(--ease-out-expo) forwards;
}

.animate-fade-in-right {
    animation: fadeInRight var(--duration-normal) var(--ease-out-expo) forwards;
}

.animate-scale-in {
    animation: scaleIn var(--duration-normal) var(--ease-spring) forwards;
}

.animate-scale-in-bounce {
    animation: scaleInBounce var(--duration-slow) var(--ease-spring) forwards;
}

/* === Continuous Animations === */
.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-spin-slow {
    animation: spin 3s linear infinite;
}

.animate-bounce {
    animation: bounce 2s ease-in-out infinite;
}

.animate-shimmer {
    background: var(--gradient-shimmer);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.animate-gradient {
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* === Animation Delays === */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

.delay-700 {
    animation-delay: 700ms;
}

.delay-800 {
    animation-delay: 800ms;
}

/* Initial state for delayed animations */
[class*="delay-"] {
    opacity: 0;
}

/* ============================================
   4. GRADIENT UTILITY CLASSES
   ============================================ */

/* === Background Gradients === */
.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.bg-gradient-success {
    background: var(--gradient-success) !important;
}

.bg-gradient-danger {
    background: var(--gradient-danger) !important;
}

.bg-gradient-warning {
    background: var(--gradient-warning) !important;
}

.bg-gradient-info {
    background: var(--gradient-info) !important;
}

.bg-gradient-dark {
    background: var(--gradient-dark) !important;
}

.bg-gradient-cosmic {
    background: var(--gradient-cosmic) !important;
}

.bg-gradient-ocean {
    background: var(--gradient-ocean) !important;
}

.bg-gradient-sunset {
    background: var(--gradient-sunset) !important;
}

.bg-gradient-aurora {
    background: var(--gradient-aurora) !important;
}

.bg-gradient-midnight {
    background: var(--gradient-midnight) !important;
}

.bg-gradient-royal {
    background: var(--gradient-royal) !important;
}

/* === Animated Gradient Background === */
.bg-gradient-animated {
    background: var(--gradient-animated);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* === Gradient Text === */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-success {
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === Gradient Borders === */
.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
        var(--gradient-primary) border-box;
}

.border-gradient-animated {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
        var(--gradient-animated) border-box;
    background-size: 400% 400%;
    animation: gradientShift 5s ease infinite;
}

/* ============================================
   5. PREMIUM COMPONENT STYLES
   ============================================ */

/* === Premium Cards === */
.card-premium {
    background: var(--color-white);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-out-expo);
    overflow: hidden;
}

.card-premium:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-premium-glow:hover {
    box-shadow: var(--shadow-lg), var(--glow-primary);
}

/* Card with gradient accent */
.card-gradient-accent {
    position: relative;
    overflow: hidden;
}

.card-gradient-accent::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

/* Card with full gradient background */
.card-gradient {
    background: var(--gradient-primary);
    color: white;
}

/* === Premium Buttons === */
.btn-premium {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all var(--duration-normal) var(--ease-out-expo);
    z-index: 1;
}

.btn-premium::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    z-index: -2;
}

.btn-premium::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary-hover);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--duration-normal);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--glow-primary);
}

.btn-premium:hover::after {
    opacity: 1;
}

.btn-premium:active {
    transform: translateY(0);
}

/* Button Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* === Premium Form Inputs === */
.form-control-premium {
    border: 2px solid #e9ecef;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.form-control-premium:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(94, 114, 228, 0.15);
    transform: translateY(-1px);
}

.form-control-premium.is-invalid {
    animation: shake 0.5s ease-in-out;
}

/* === Status Indicators === */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot-success {
    background: var(--color-success);
}

.status-dot-warning {
    background: var(--color-warning);
}

.status-dot-danger {
    background: var(--color-danger);
}

.status-dot-info {
    background: var(--color-info);
}

/* === Premium Badges === */
.badge-premium {
    padding: 0.5em 1em;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.badge-gradient {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.badge-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* === Icon Containers === */
.icon-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.icon-premium:hover {
    transform: translateY(-3px) scale(1.05);
}

.icon-float {
    animation: float 4s ease-in-out infinite;
}

/* === Progress Bars === */
.progress-premium {
    height: 8px;
    border-radius: var(--radius-full);
    background: #e9ecef;
    overflow: hidden;
}

.progress-premium .progress-bar {
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 1s var(--ease-out-expo);
}

.progress-animated .progress-bar {
    animation: shimmer 2s infinite;
    background-size: 200% 100%;
}

/* ============================================
   6. PREMIUM SIDEBAR STYLES
   ============================================ */

.sidebar-premium {
    background: var(--sidebar-gradient);
    box-shadow: var(--shadow-lg);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
    .sidebar-premium {
        min-height: 100vh;
        height: 100%;
    }

    .sidebar-premium .navbar-inner {
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 60px;
    }
}

.sidebar-premium .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    margin: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.sidebar-premium .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar-premium .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   7. PREMIUM NAVBAR/HEADER STYLES
   ============================================ */

.header-premium {
    background: var(--gradient-primary) !important;
    position: relative;
    position: relative;
    z-index: 1030;
}

.header-premium .navbar-nav .dropdown-menu {
    z-index: 1050;
    margin-top: 10px;
}

.header-premium .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    border-radius: 4px;
    z-index: -1;
}

.header-premium::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* ============================================
   8. LOADING & SKELETON STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: var(--radius-lg);
}

/* === Loading Spinner === */
.spinner-premium {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(94, 114, 228, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   9. MODAL & TOAST ANIMATIONS
   ============================================ */

.modal-premium .modal-content {
    animation: scaleInBounce var(--duration-slow) var(--ease-spring) forwards;
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.toast-premium {
    animation: slideInRight var(--duration-normal) var(--ease-out-expo) forwards;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.toast-premium.toast-exit {
    animation: slideInRight var(--duration-normal) var(--ease-out-expo) reverse forwards;
}

/* ============================================
   10. SCROLL REVEAL ANIMATIONS
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--duration-slow) var(--ease-out-expo);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all var(--duration-slow) var(--ease-out-expo);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all var(--duration-slow) var(--ease-out-expo);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   11. DATA TABLE ENHANCEMENTS
   ============================================ */

.table-premium {
    border-collapse: separate;
    border-spacing: 0;
}

.table-premium thead th {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    padding: 1rem;
    border: none;
}

.table-premium thead th:first-child {
    border-radius: var(--radius-lg) 0 0 0;
}

.table-premium thead th:last-child {
    border-radius: 0 var(--radius-lg) 0 0;
}

.table-premium tbody tr {
    transition: all var(--duration-fast) var(--ease-out-expo);
}

.table-premium tbody tr:hover {
    background: rgba(94, 114, 228, 0.05);
    transform: scale(1.01);
}

.table-premium tbody td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

/* ============================================
   12. STAT COUNTER ANIMATION
   ============================================ */

.stat-counter {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    animation: countUp var(--duration-slow) var(--ease-out-expo) forwards;
}

.stat-card {
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-icon {
    transition: all var(--duration-normal) var(--ease-spring);
}

/* ============================================
   13. CHAT & MESSAGE ANIMATIONS
   ============================================ */

.message-in {
    animation: fadeInLeft var(--duration-normal) var(--ease-out-expo) forwards;
}

.message-out {
    animation: fadeInRight var(--duration-normal) var(--ease-out-expo) forwards;
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: #f1f3f4;
    border-radius: var(--radius-xl);
    width: fit-content;
}

.typing-indicator span {
    width: 10px;
    height: 10px;
    background: var(--gradient-primary);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ============================================
   14. HOVER EFFECTS
   ============================================ */

/* Lift on hover */
.hover-lift {
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Glow on hover */
.hover-glow:hover {
    box-shadow: var(--glow-primary);
}

/* Scale on hover */
.hover-scale {
    transition: transform var(--duration-fast) var(--ease-out-expo);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Gradient shift on hover */
.hover-gradient-shift {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hover-gradient-shift::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary-hover);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--duration-normal);
}

.hover-gradient-shift:hover::before {
    opacity: 1;
}

/* ============================================
   15. RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    .card-premium:hover {
        transform: none;
    }

    .hover-lift:hover {
        transform: none;
    }

    .stat-counter {
        font-size: 2rem;
    }
}

/* ============================================
   16. REDUCED MOTION SUPPORT
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-float,
    .animate-pulse,
    .animate-bounce,
    .animate-spin,
    .animate-shimmer,
    .animate-gradient {
        animation: none !important;
    }
}

/* ============================================
   17. PRINT STYLES
   ============================================ */

@media print {

    .animate-float,
    .animate-pulse,
    .animate-bounce,
    .animate-spin {
        animation: none !important;
    }

    .card-premium {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* ============================================
   18. CHAT CONVERSATIONS
   ============================================ */

.bg-primary-light {
    background-color: rgba(94, 114, 228, 0.1) !important;
}

.border-left-primary {
    border-left: 3px solid #5e72e4 !important;
}

.contact-list .shadow-sm:hover {
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
    transform: translateX(3px);
}

/* ============================================
   19. CHAT LAYOUT FIXES
   ============================================ */
.chat-grid {
    display: flex;
    height: calc(100vh - 85px);
    margin-top: 15px;
    margin-bottom: 0;
    /* Full height minus navbar + margin */
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 2rem 0 rgba(136, 152, 170, .15);
}

.chat-grid>div {
    height: 100%;
}

.chat-grid>div:first-child {
    /* Conversations list width */
    width: 350px;
    flex-shrink: 0;
    border-right: 1px solid #e9ecef;
}

.chat-grid>div:last-child {
    /* Chat area */
    flex-grow: 1;
    min-width: 0;
    /* Prevent flex overflow */
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .chat-grid {
        height: calc(100vh - 70px);
        margin: -15px;
        /* Counteract padding if any */
        border-radius: 0;
    }

    .chat-grid>div:first-child {
        width: 100%;
        display: none;
        /* Hidden by default on mobile unless active */
    }

    .chat-grid>div:first-child.active {
        display: block;
    }
}

/* ============================================
   20. PREMIUM SCROLLBARS
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e9ecef;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ced4da;
}

/* Darker thumb for specific areas if needed */
.header-premium ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   21. CHAT ANIMATIONS
   ============================================ */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 10px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.card.message-contact,
.card.message-agent {
    animation: slideInUp 0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

/* Helper to ensure smooth rendering */
.card-body {
    backface-visibility: hidden;
}