/* ===== Global Styles — LicenseVault License Manager ===== */

:root {
    --bg-primary: #0B0F19;
    --bg-secondary: #0F172A;
    --bg-surface: rgba(255, 255, 255, 0.03);
    --bg-surface-hover: rgba(255, 255, 255, 0.05);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --accent-emerald: #10B981;
    --accent-teal: #14B8A6;
    --accent-red: #EF4444;
    --accent-warning: #F59E0B;
    --accent-info: #3B82F6;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== App Loading Screen ===== */
.app-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    gap: 1.5rem;
}

.app-loading-logo {
    animation: pulse 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-logo-img {
    height: 64px;
    width: auto;
    object-fit: contain;
}

/* Default: Dark mode */
.logo-dark { display: block; }
.logo-light { display: none; }

/* Light mode */
.mud-theme-light .logo-dark { display: none; }
.mud-theme-light .logo-light { display: block; }

.app-loading-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.app-loading-bar {
    width: 120px;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.app-loading-bar-progress {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, var(--accent-emerald), var(--accent-teal));
    border-radius: 2px;
    animation: loading 1.5s ease-in-out infinite;
}

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

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

/* ===== Blazor Error UI ===== */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(239, 68, 68, 0.1);
    border-top: 1px solid rgba(239, 68, 68, 0.2);
    padding: 1rem 1.5rem;
    z-index: 9999;
}

#blazor-error-ui .error-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 1400px;
    margin: 0 auto;
    font-size: 0.875rem;
    color: #FCA5A5;
}

#blazor-error-ui .reload {
    margin-left: auto;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

#blazor-error-ui .reload:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== Selection ===== */
::selection {
    background: rgba(16, 185, 129, 0.3);
    color: #F8FAFC;
}

/* ===== Focus ===== */
:focus-visible {
    outline: 2px solid var(--accent-emerald);
    outline-offset: 2px;
}

/* ===== Utility Classes ===== */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.glass-card-hover {
    transition: all var(--transition-normal);
}

.glass-card-hover:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-glow);
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.border-subtle {
    border: 1px solid var(--border-subtle);
}

/* ===== User Menu Popover - Solid Background (Dark Mode Only) ===== */
.user-menu-popover {
    background: #0F172A !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

.user-menu-popover .mud-list-item {
    color: #F8FAFC !important;
}

.user-menu-popover .mud-list-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.user-menu-popover .mud-divider {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Light mode override */
.mud-theme-light .user-menu-popover {
    background: #FFFFFF !important;
    border-color: #E2E8F0 !important;
}

.mud-theme-light .user-menu-popover .mud-list-item {
    color: #0F172A !important;
}

.mud-theme-light .user-menu-popover .mud-list-item:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}
