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

:root {
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-warning: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%);
    --gradient-enterprise: linear-gradient(135deg, #4776E6 0%, #8E54E9 100%);
    --gradient-dark: linear-gradient(135deg, #232526 0%, #414345 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 4px 30px rgba(102, 126, 234, 0.3);
    
    /* Theme-aware colors - Light mode defaults */
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg-card: white;
    --bg-page: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    --border-color: rgba(0, 0, 0, 0.05);
}

/* Dark mode overrides */
.mud-theme-dark {
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --bg-card: #1e1e1e;
    --bg-page: #121212;
    --border-color: rgba(255, 255, 255, 0.1);
}

/* Global dark mode text color fixes for inline styles */
.mud-theme-dark [style*="color: #6b7280"],
.mud-theme-dark [style*="color: #1a1a2e"],
.mud-theme-dark [style*="color:#6b7280"],
.mud-theme-dark [style*="color:#1a1a2e"] {
    color: var(--text-secondary) !important;
}

.mud-theme-dark [style*="color: #9ca3af"],
.mud-theme-dark [style*="color:#9ca3af"] {
    color: var(--text-muted) !important;
}

/* Dark mode table row hover */
.mud-theme-dark .mud-table-row:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Dark mode dialog */
.mud-theme-dark .mud-dialog {
    background: #1e1e1e !important;
}

/* Dark mode input backgrounds */
.mud-theme-dark .mud-input-control .mud-input-slot {
    background: rgba(255, 255, 255, 0.05);
}

/* Dark mode MudPaper */
.mud-theme-dark .mud-paper {
    background: var(--bg-card) !important;
}

/* Dark mode hero section keeps its gradient */
.mud-theme-dark .hero-section {
    background: var(--gradient-primary);
}

/* Dark mode chips */
.mud-theme-dark .mud-chip[style*="background: rgba(102, 126, 234, 0.1)"] {
    background: rgba(102, 126, 234, 0.2) !important;
}

/* Dark mode body text */
.mud-theme-dark .mud-typography {
    color: inherit;
}

/* Dark mode table headers inherit text color */
.mud-theme-dark .mud-table-head .mud-table-cell {
    color: var(--text-secondary) !important;
}

/* Dark mode default text */
.mud-theme-dark {
    color: var(--text-primary);
}

/* Dark mode code blocks */
.mud-theme-dark code {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e0e0e0 !important;
}

/* Fix inline style background colors in dark mode */
.mud-theme-dark [style*="background: #f3f4f6"],
.mud-theme-dark [style*="background:#f3f4f6"] {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e0e0e0 !important;
}

html, body {
    font-family: 'Inter', 'Roboto', sans-serif;
    min-height: 100vh;
}

/* Theme-aware text utility classes */
.text-primary-theme { color: var(--text-primary) !important; }
.text-secondary-theme { color: var(--text-secondary) !important; }
.text-muted-theme { color: var(--text-muted) !important; }
.bg-card-theme { background: var(--bg-card) !important; }

/* Modern Card Styles */
.modern-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.modern-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
}

.mud-theme-dark .glass-card {
    background: rgba(30, 30, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient Text */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    padding: 3rem 2rem;
    border-radius: 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Stat Card */
.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.stat-card.primary::after { background: var(--gradient-primary); }
.stat-card.secondary::after { background: var(--gradient-secondary); }
.stat-card.success::after { background: var(--gradient-success); }
.stat-card.warning::after { background: var(--gradient-warning); }

/* Pricing Card */
.pricing-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow);
}

.pricing-card.popular {
    border-color: #667eea;
}

.pricing-card.popular::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Auth Layout */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: 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='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: slide 20s linear infinite;
}

@keyframes slide {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-50%, -50%); }
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    max-width: 440px;
    width: 100%;
}

/* Modern Button */
.btn-gradient {
    background: var(--gradient-primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5) !important;
}

/* Navigation */
.modern-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-item-modern {
    border-radius: 12px;
    margin: 4px 8px;
    transition: all 0.2s ease;
}

.nav-item-modern:hover {
    background: rgba(102, 126, 234, 0.1);
}

.nav-item-modern.active {
    background: var(--gradient-primary);
    color: white !important;
}

/* Table Modern */
.modern-table {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

/* Status Badge */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: linear-gradient(135deg, rgba(17, 153, 142, 0.15) 0%, rgba(56, 239, 125, 0.15) 100%);
    color: #11998e;
}

.status-badge.expired {
    background: rgba(242, 153, 74, 0.15);
    color: #f2994a;
}

.status-badge.revoked {
    background: rgba(255, 87, 87, 0.15);
    color: #f5576c;
}

/* API Key Display */
.api-key-display {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #00ff88;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

.slide-up {
    animation: slideUp 0.6s ease-out;
}

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

/* Blazor Error */
#blazor-error-ui {
    background: #f5576c;
    color: white;
    bottom: 0;
    box-shadow: 0 -4px 20px rgba(245, 87, 108, 0.3);
    display: none;
    left: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-radius: 12px 12px 0 0;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
}

.blazor-error-boundary {
    background: #f5576c;
    padding: 1.5rem;
    color: white;
    border-radius: 12px;
}

.blazor-error-boundary::after {
    content: "An error has occurred. Please refresh the page."
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5a6fd6 0%, #6a4190 100%);
}

