/* ================================================
   ECMS - Modern Professional Design System
   ================================================ */

:root {
    /* Primary Colors - Red Theme */
    --primary-50: #fef2f2;
    --primary-100: #fee2e2;
    --primary-200: #fecaca;
    --primary-300: #fca5a5;
    --primary-400: #f87171;
    --primary-500: #ef4444;
    --primary-600: #dc2626;
    --primary-700: #b91c1c;
    --primary-800: #991b1b;
    --primary-900: #7f1d1d;

    /* Accent Colors */
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-purple: #8b5cf6;
    --accent-orange: #f97316;
    --accent-indigo: #6366f1;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

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

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.18);

    /* Animation Duration */
    --duration-fast: 150ms;
    --duration-base: 200ms;
    --duration-medium: 300ms;
    --duration-slow: 500ms;
}

/* ================================================
   Typography Enhancements
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================================
   Glassmorphism Components
   ================================================ */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
}

.glass-card-strong {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ================================================
   Neumorphism Components
   ================================================ */

.neu-card {
    background: linear-gradient(145deg, #ffffff, #f3f4f6);
    box-shadow:
        8px 8px 16px rgba(163, 177, 198, 0.4),
        -8px -8px 16px rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    transition: all var(--duration-medium) ease;
}

.neu-card:hover {
    box-shadow:
        12px 12px 24px rgba(163, 177, 198, 0.5),
        -12px -12px 24px rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.neu-pressed {
    box-shadow:
        inset 4px 4px 8px rgba(163, 177, 198, 0.4),
        inset -4px -4px 8px rgba(255, 255, 255, 0.8);
}

/* ================================================
   Modern Button Styles
   ================================================ */

.btn-modern {
    position: relative;
    overflow: hidden;
    transition: all var(--duration-base) cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width var(--duration-medium) ease, height var(--duration-medium) ease;
}

.btn-modern:hover::before {
    width: 300px;
    height: 300px;
}

.btn-modern:active {
    transform: scale(0.98);
}

/* ================================================
   Enhanced Card Hover Effects
   ================================================ */

.card-hover {
    position: relative;
    transition: all var(--duration-medium) cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(239, 68, 68, 0.05));
    opacity: 0;
    border-radius: inherit;
    transition: opacity var(--duration-medium) ease;
    pointer-events: none;
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(220, 38, 38, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-hover:hover::after {
    opacity: 1;
}

/* ================================================
   Gradient Text Effects
   ================================================ */

.gradient-text {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-blue {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ================================================
   Animated Gradient Backgrounds
   ================================================ */

.gradient-bg-animated {
    background: linear-gradient(-45deg, #dc2626, #ef4444, #f97316, #ec4899);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

/* ================================================
   Smooth Scroll
   ================================================ */

* {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-500), var(--primary-600));
    border-radius: var(--radius-full);
    border: 2px solid var(--gray-100);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-600), var(--primary-700));
}

/* ================================================
   Micro-interactions
   ================================================ */

.scale-on-hover {
    transition: transform var(--duration-base) cubic-bezier(0.4, 0, 0.2, 1);
}

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

.scale-on-hover:active {
    transform: scale(0.95);
}

/* Icon Animations */
.icon-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.icon-spin-slow {
    animation: spin 8s linear infinite;
}

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

/* ================================================
   Badge Styles
   ================================================ */

.badge-modern {
    position: relative;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-base) ease;
}

.badge-modern:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* ================================================
   Loading Animations
   ================================================ */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

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

.pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ================================================
   Focus Styles (Accessibility)
   ================================================ */

*:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ================================================
   Sidebar Modern Enhancements
   ================================================ */

.sidebar-nav-item {
    position: relative;
    transition: all var(--duration-base) ease;
}

.sidebar-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: white;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: height var(--duration-base) ease;
}

.sidebar-nav-item:hover::before,
.sidebar-nav-item.active::before {
    height: 70%;
}

/* ================================================
   Mobile Slide-in Animation
   ================================================ */

.slide-in-left {
    animation: slideInLeft var(--duration-medium) ease-out;
}

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

.slide-out-left {
    animation: slideOutLeft var(--duration-medium) ease-in;
}

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

/* ================================================
   Fade Transitions
   ================================================ */

.fade-in {
    animation: fadeIn var(--duration-medium) ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in-up {
    animation: fadeInUp var(--duration-medium) ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered Animation */
.stagger-fade-in > * {
    opacity: 0;
    animation: fadeInUp var(--duration-medium) ease-out forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0ms; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 50ms; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 100ms; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 150ms; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 200ms; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 250ms; }
.stagger-fade-in > *:nth-child(7) { animation-delay: 300ms; }
.stagger-fade-in > *:nth-child(8) { animation-delay: 350ms; }

/* ================================================
   Tooltip Modern Style
   ================================================ */

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 0.75rem;
    background: var(--gray-900);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--duration-base) ease;
    box-shadow: var(--shadow-lg);
}

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

/* ================================================
   Responsive Utilities
   ================================================ */

@media (max-width: 640px) {
    .glass-card {
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
}

/* ================================================
   Print Styles
   ================================================ */

@media print {
    .no-print {
        display: none !important;
    }

    .glass-card,
    .neu-card {
        box-shadow: none !important;
        background: white !important;
    }
}
