﻿/* Import modern fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Root variables for consistent theming */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --error-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.1);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;

    --transition-fast: all 0.15s ease-out;
    --transition-normal: all 0.3s ease-out;
    --transition-slow: all 0.5s ease-out;
}

/* Global reset and base styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced focus styles */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

/* Utility classes */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
}

.glass-effect:hover {
    background: var(--glass-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.gradient-primary {
    background: var(--primary-gradient);
}

.gradient-secondary {
    background: var(--secondary-gradient);
}

.gradient-text-primary {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-secondary {
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced animation classes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
    40%, 43% { transform: translateY(-10px); }
    70% { transform: translateY(-5px); }
    90% { transform: translateY(-2px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-fadeIn { animation: fadeIn 0.5s ease-out; }
.animate-fadeInUp { animation: fadeInUp 0.6s ease-out; }
.animate-fadeInDown { animation: fadeInDown 0.6s ease-out; }
.animate-fadeInLeft { animation: fadeInLeft 0.6s ease-out; }
.animate-fadeInRight { animation: fadeInRight 0.6s ease-out; }
.animate-scaleIn { animation: scaleIn 0.4s ease-out; }
.animate-slideUp { animation: slideUp 0.4s ease-out; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-bounce { animation: bounce 1s infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* Enhanced hover effects */
.hover-lift {
    transition: var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.hover-scale {
    transition: var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Enhanced MudBlazor component overrides */
.mud-card {
    transition: var(--transition-normal);
}

.mud-button-root {
    transition: var(--transition-fast);
    font-weight: 500;
}

.mud-button-filled-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: var(--shadow-md);
}

.mud-button-filled-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.mud-button-filled-secondary {
    background: var(--secondary-gradient);
    border: none;
    box-shadow: var(--shadow-md);
}

.mud-button-filled-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.mud-input-outlined .mud-input-outlined-border {
    border-radius: var(--border-radius-md);
    transition: var(--transition-fast);
}

.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: rgba(139, 92, 246, 0.5);
}

.mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.mud-navmenu .mud-nav-link {
    border-radius: var(--border-radius-md);
    margin-bottom: 0.25rem;
    transition: var(--transition-fast);
}

.mud-navmenu .mud-nav-link:hover {
    background: var(--glass-hover);
}

.mud-navmenu .mud-nav-link.active {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

/* Enhanced scroll bars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Loading states */
.loading-skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 37%, rgba(255, 255, 255, 0.05) 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 100% 50%; }
    100% { background-position: -100% 50%; }
}

/* Enhanced log entry styles */
.log-entry {
    transition: var(--transition-fast);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-sm);
}

/* Responsive utilities */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    * {
        color: black !important;
        background: white !important;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(0, 0, 0, 0.8);
        --glass-border: rgba(255, 255, 255, 0.5);
        --glass-hover: rgba(255, 255, 255, 0.2);
    }
}

/* Dark mode specific adjustments */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.05);
        --glass-border: rgba(255, 255, 255, 0.1);
        --glass-hover: rgba(255, 255, 255, 0.1);
    }
}

/* Light mode specific adjustments */
@media (prefers-color-scheme: light) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.8);
        --glass-border: rgba(0, 0, 0, 0.1);
        --glass-hover: rgba(0, 0, 0, 0.05);
    }
}

/* Custom MudBlazor theme overrides for better integration */
.mud-theme-primary {
    color: #8b5cf6 !important;
}

.mud-theme-secondary {
    color: #06b6d4 !important;
}

/* Enhanced notification styles */
.mud-snackbar {
    border-radius: var(--border-radius-lg) !important;
    backdrop-filter: blur(20px);
}

.mud-snackbar-success {
    background: var(--success-gradient) !important;
}

.mud-snackbar-error {
    background: var(--error-gradient) !important;
}

.mud-snackbar-warning {
    background: var(--warning-gradient) !important;
}

/* Enhanced dialog styles */
.mud-dialog {
    border-radius: var(--border-radius-lg) !important;
    backdrop-filter: blur(20px);
}

/* Custom focus ring for better accessibility */
.focus-ring:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

/* Status indicators */
.status-online {
    color: #10b981;
    animation: pulse 2s infinite;
}

.status-offline {
    color: #ef4444;
}

.status-warning {
    color: #f59e0b;
    animation: pulse 2s infinite;
}

/* Enhanced typography */
.text-gradient-primary {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.text-gradient-secondary {
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Enhanced spacing utilities */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }