/* Root Variables - Modern Blue & White Palette */
:root {
    --brand-50: #eff6ff;
    --brand-100: #dbeafe;
    --brand-200: #bfdbfe;
    --brand-300: #93c5fd;
    --brand-400: #60a5fa;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-800: #1e40af;
    --brand-900: #1e3a8a;
    
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --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);
    
    --blur-sm: blur(4px);
    --blur: blur(8px);
    --blur-md: blur(12px);
    --blur-lg: blur(16px);
    --blur-xl: blur(24px);
    --blur-2xl: blur(40px);
    
    --duration-75: 75ms;
    --duration-100: 100ms;
    --duration-150: 150ms;
    --duration-200: 200ms;
    --duration-300: 300ms;
    --duration-500: 500ms;
    --duration-700: 700ms;
    --duration-1000: 1000ms;
    
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Custom Scrollbar - Modern Style */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--neutral-100);
}

::-webkit-scrollbar-thumb {
    background: var(--brand-400);
    border-radius: 3px;
    transition: background var(--duration-200) var(--ease);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-500);
}

::-webkit-scrollbar-corner {
    background: var(--neutral-100);
}

/* Selection Styles */
::selection {
    background: var(--brand-100);
    color: var(--brand-900);
}

::-moz-selection {
    background: var(--brand-100);
    color: var(--brand-900);
}

/* Focus Styles */
:focus {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

/* Modern Typography */
.text-balance {
    text-wrap: balance;
}

/* Enhanced Animations */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-blue {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

@keyframes float-gentle {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Animation Classes */
.animate-fade-in-up {
    animation: fade-in-up 0.6s var(--ease-out) forwards;
}

.animate-fade-in-down {
    animation: fade-in-down 0.6s var(--ease-out) forwards;
}

.animate-slide-in-right {
    animation: slide-in-right 0.6s var(--ease-out) forwards;
}

.animate-pulse-blue {
    animation: pulse-blue 2s var(--ease-in-out) infinite;
}

.animate-float-gentle {
    animation: float-gentle 3s var(--ease-in-out) infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Enhanced Button Components */
.btn {
    @apply inline-flex items-center justify-center font-semibold transition-all duration-200 transform focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    @apply px-3 py-1.5 text-sm rounded-lg;
}

.btn-md {
    @apply px-4 py-2.5 text-sm rounded-lg;
}

.btn-lg {
    @apply px-6 py-3 text-base rounded-xl;
}

.btn-xl {
    @apply px-8 py-4 text-lg rounded-xl;
}

.btn-primary {
    @apply bg-brand-600 hover:bg-brand-700 text-white shadow-lg shadow-brand-500/25 focus:ring-brand-500;
}

.btn-secondary {
    @apply bg-white hover:bg-neutral-50 text-neutral-900 border-2 border-neutral-200 hover:border-brand-300 shadow-lg focus:ring-brand-500;
}

.btn-outline {
    @apply bg-transparent border-2 border-brand-600 text-brand-600 hover:bg-brand-600 hover:text-white focus:ring-brand-500;
}

.btn-ghost {
    @apply bg-transparent hover:bg-neutral-100 text-neutral-700 hover:text-neutral-900 focus:ring-neutral-500;
}

/* Enhanced Card Components */
.card {
    @apply bg-white rounded-2xl border border-neutral-200/50 shadow-lg transition-all duration-300;
}

.card:hover {
    @apply shadow-xl transform scale-105;
}

.card-elevated {
    @apply shadow-xl;
}

.card-elevated:hover {
    @apply shadow-2xl transform scale-105;
}

.card-header {
    @apply p-6 border-b border-neutral-200/50;
}

.card-body {
    @apply p-6;
}

.card-footer {
    @apply p-6 border-t border-neutral-200/50;
}

/* Glass Morphism Effects */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Navigation Enhancements */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
    transition: width var(--duration-300) var(--ease);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Form Enhancements */
.form-input {
    @apply w-full bg-white border border-neutral-300 rounded-lg px-4 py-3 text-neutral-900 placeholder-neutral-500 transition-all duration-200;
    @apply focus:outline-none focus:ring-2 focus:ring-brand-500 focus:border-transparent;
    @apply hover:border-neutral-400;
}

.form-input:focus {
    @apply shadow-lg shadow-brand-500/10;
}

.form-label {
    @apply block text-sm font-semibold text-neutral-700 mb-2;
}

.form-group {
    @apply mb-6;
}

.form-error {
    @apply text-red-600 text-sm mt-1;
}

.form-success {
    @apply text-green-600 text-sm mt-1;
}

/* Status Indicators */
.status-dot {
    @apply w-2 h-2 rounded-full;
}

.status-online {
    @apply bg-green-500 animate-pulse;
}

.status-offline {
    @apply bg-red-500;
}

.status-loading {
    @apply bg-yellow-500 animate-pulse;
}

/* Badge Components */
.badge {
    @apply inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold;
}

.badge-sm {
    @apply px-2 py-0.5 text-xs;
}

.badge-lg {
    @apply px-3 py-1.5 text-sm;
}

.badge-primary {
    @apply bg-brand-100 text-brand-800;
}

.badge-secondary {
    @apply bg-neutral-100 text-neutral-800;
}

.badge-success {
    @apply bg-green-100 text-green-800;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800;
}

.badge-danger {
    @apply bg-red-100 text-red-800;
}

/* Loading States */
.skeleton {
    @apply bg-neutral-200 animate-pulse rounded;
}

.spinner {
    @apply inline-block w-4 h-4 border-2 border-neutral-300 border-l-brand-600 rounded-full animate-spin;
}

.spinner-lg {
    @apply w-8 h-8 border-4;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-pattern {
    background-image: 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='%23f3f4f6' fill-opacity='0.4'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.shadow-brand {
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.1), 0 4px 6px -4px rgba(59, 130, 246, 0.1);
}

.shadow-brand-lg {
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.1), 0 8px 10px -6px rgba(59, 130, 246, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .card {
        margin: 0.5rem;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .btn-xl {
        @apply px-6 py-3 text-base;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .auto-dark {
        @apply bg-neutral-900 text-white;
    }
    
    .auto-dark .card {
        @apply bg-neutral-800 border-neutral-700;
    }
    
    .auto-dark .form-input {
        @apply bg-neutral-800 border-neutral-700 text-white;
    }
}

/* 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;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    .btn-primary {
        @apply border-2 border-brand-800;
    }
    
    .card {
        @apply border-2 border-neutral-400;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card {
        @apply shadow-none border border-neutral-400;
    }
}

/* Custom Utilities */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

/* Performance Optimizations */
.contain-layout {
    contain: layout;
}

.contain-paint {
    contain: paint;
}

.contain-size {
    contain: size;
}

.contain-strict {
    contain: strict;
}