@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --bg-gradient: linear-gradient(145deg, #1e2235, #111827);
    --glass-bg: rgba(31, 41, 55, 0.7);
    --border-color: rgba(75, 85, 99, 0.3);
}

* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #0f1118;
    background-image: 
        radial-gradient(circle at 25% 15%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 75% 85%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Dark theme toggle */
.dark-theme {
    --bg-gradient: linear-gradient(145deg, #0f172a, #020617);
    background-color: #020617;
}

/* Loading screen animations */
#loading-screen {
    backdrop-filter: blur(20px);
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loading-screen.hide {
    opacity: 0;
    visibility: hidden;
}

/* Enhanced gradients and glass effects */
.gradient-bg {
    background: var(--bg-gradient);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-effect {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--glass-bg);
}

/* Improved animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

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

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% { 
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.4);
    }
}

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

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-glow {
    animation: glow 3s ease-in-out infinite;
}

/* Enhanced card hover effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.card-hover:hover::before {
    left: 100%;
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Chart container improvements */
.chart-container {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Enhanced text animations */
.animated-text {
    background: linear-gradient(
        90deg, 
        #3B82F6, 
        #8B5CF6, 
        #EC4899, 
        #10B981,
        #F59E0B,
        #EF4444
    );
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 8s ease infinite;
    font-weight: 800;
    letter-spacing: -0.025em;
}

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

/* Status indicators and pills */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 10px currentColor;
}

.indicator-green { 
    background-color: #10B981; 
    box-shadow: 0 0 10px #10B981;
}
.indicator-yellow { 
    background-color: #F59E0B; 
    box-shadow: 0 0 10px #F59E0B;
}
.indicator-red { 
    background-color: #EF4444; 
    box-shadow: 0 0 10px #EF4444;
}

.status-pill {
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.status-pill:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Progress bars */
.progress-bar {
    height: 6px;
    background: rgba(75, 85, 99, 0.3);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Network interface cards */
.network-interface-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
}

.network-interface-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Toast notifications */
.toast {
    background: var(--bg-gradient);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid #10B981;
}

.toast.error {
    border-left: 4px solid #EF4444;
}

.toast.warning {
    border-left: 4px solid #F59E0B;
}

.toast.info {
    border-left: 4px solid #3B82F6;
}

/* Button enhancements */
button {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

button:active::before {
    width: 300px;
    height: 300px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3B82F6, #8B5CF6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563EB, #7C3AED);
}

/* SweetAlert2 Custom Styles */
.swal2-popup {
    border-radius: 1rem !important;
    background: var(--bg-gradient) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
}

.swal2-title, .swal2-content {
    color: #fff !important;
}

.swal2-actions button {
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    padding: 0.75rem 2rem !important;
    transition: all 0.2s ease !important;
    backdrop-filter: blur(12px) !important;
}

.swal2-actions button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

/* Responsive design improvements */
@media (max-width: 768px) {
    .chart-container {
        width: 80px;
        height: 80px;
    }
    
    .card-hover:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .gradient-bg {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }
    
    .grid {
        gap: 1rem;
    }
    
    .status-pill {
        padding: 0.25rem 0.5rem;
        font-size: 0.625rem;
    }
}

/* Loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #374151 25%, #4B5563 50%, #374151 75%);
    background-size: 200% 100%;
    animation: loading 2s infinite;
}

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

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for accessibility */
button:focus,
input:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gradient-bg {
        background: #1F2937;
        border: 2px solid #6B7280;
    }
    
    .status-indicator {
        border: 2px solid #FFFFFF;
    }
}