/* Dark Mode Theme & Design Tokens */
:root {
    --color-bg-primary: #0f172a; /* Slate 900 */
    --color-bg-secondary: #1e293b; /* Slate 800 */
    --color-bg-card: #1e293b;
    --color-text-primary: #f8fafc; /* Slate 50 */
    --color-text-secondary: #94a3b8; /* Slate 400 */
    --color-accent: #6366f1; /* Indigo 500 */
    --color-accent-hover: #4f46e5; /* Indigo 600 */
    --color-danger: #ef4444; /* Red 500 */
    --color-success: #22c55e; /* Green 500 */
}

body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card {
    background-color: var(--color-bg-card);
    border-radius: 0.75rem; /* 12px */
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* Typography */
h1, h2, h3, h4 {
    color: white;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Buttons */
.btn-primary {
    background-color: var(--color-accent);
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}
.btn-primary:hover {
    background-color: var(--color-accent-hover);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

/* Inputs */
.input-field {
    background-color: #0f172a;
    border: 1px solid #334155;
    color: white;
    border-radius: 0.5rem;
    padding: 0.75rem;
    width: 100%;
    transition: border-color 0.2s;
}
.input-field:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Interactive Elements */
.blur-text {
    filter: blur(6px);
    transition: filter 0.3s ease;
    cursor: pointer;
    user-select: none;
}
.blur-text:hover, .blur-text.revealed {
    filter: blur(0);
}

/* Loading Skeletons */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.25rem;
}
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Enhanced Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
    }
}

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

/* Enhanced Card Effects */
.card-enhanced {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-enhanced::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-enhanced:hover::before {
    left: 100%;
}

.card-enhanced:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Glassmorphism Enhancement */
.glass-enhanced {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Animated Gradient Background */
.gradient-bg {
    background: linear-gradient(-45deg, #0f172a, #1e293b, #334155, #475569);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

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

/* Interactive Elements */
.interactive-element {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive-element:hover {
    transform: scale(1.05);
}

.interactive-element:active {
    transform: scale(0.98);
}

/* Status Indicators */
.status-online {
    animation: pulseGlow 2s infinite;
}

.status-warning {
    animation: pulseGlow 2s infinite;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.status-error {
    animation: pulseGlow 1.5s infinite;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* Utility Classes */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

.pulse-glow {
    animation: pulseGlow 2s infinite;
}

/* Enhanced UI/UX Improvements */

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced hover effects for cards */
.card-enhanced {
    position: relative;
    overflow: hidden;
}

.card-enhanced::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-enhanced:hover::before {
    left: 100%;
}

/* Enhanced button interactions */
.btn {
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

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

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Enhanced form inputs */
.input-field {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.input-field:focus {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

/* Enhanced status indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-online {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-offline {
    background: #6b7280;
}

.status-indicator::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

/* Enhanced loading skeletons */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

/* Enhanced scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Enhanced modal animations */
.modal-backdrop {
    backdrop-filter: blur(8px);
}

.modal-content {
    animation: modal-scale-in 0.3s ease-out;
}

@keyframes modal-scale-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Enhanced tooltip effects */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Enhanced gradient text effects */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced glass morphism effects */
.glass-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Enhanced notification badges */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Enhanced interactive elements */
.interactive-element {
    cursor: pointer;
    transition: all 0.2s ease;
}

.interactive-element:hover {
    transform: scale(1.02);
}

.interactive-element:active {
    transform: scale(0.98);
}

/* Enhanced focus states */
.focus-ring {
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: all 0.2s ease;
}

.focus-ring:focus {
    outline-color: rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}

/* Enhanced animations for inventory items */
.inventory-item {
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.5s ease-out forwards;
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced copy button effects */
.copy-button {
    position: relative;
    overflow: hidden;
}

.copy-button::after {
    content: 'Copied!';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: transform 0.3s ease;
}

.copy-button.copied::after {
    transform: translate(-50%, -50%) scale(1);
}

/* Enhanced responsive design */
@media (max-width: 768px) {
    .glass-card {
        margin: 0 1rem;
    }
    
    .card-enhanced {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Enhanced dark mode support */
@media (prefers-color-scheme: dark) {
    .glass-panel {
        background: rgba(15, 23, 42, 0.8);
    }
    
    .glass-card {
        background: rgba(30, 41, 59, 0.5);
    }
}

/* Enhanced accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Enhanced print styles */
@media print {
    .glass-panel,
    .glass-card {
        background: white !important;
        color: black !important;
        border: 1px solid #ccc !important;
    }
}

/* Enhanced Mobile & Touch Optimizations */
@media (max-width: 640px) {
    /* Better mobile spacing */
    .glass-card {
        padding: 1rem;
        margin: 0 0.5rem;
    }
    
    /* Mobile-friendly buttons */
    .btn {
        min-height: 44px; /* iOS recommended touch target */
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Better mobile navigation */
    .glass-panel {
        padding: 1rem;
    }
    
    /* Enhanced mobile inventory cards */
    #inventory-container .card-enhanced {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Mobile-friendly grid adjustments */
    #device-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* Better mobile forms */
    .input-field {
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
    }
    
    /* Enhanced mobile touch feedback */
    .btn:active,
    .card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    .glass-card {
        padding: 1.5rem;
    }
    
    #device-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Enhanced touch interactions */
.touch-feedback {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.touch-feedback:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Better mobile scrolling */
.custom-scrollbar {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.5) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(99, 102, 241, 0.5);
    border-radius: 3px;
}

/* Enhanced mobile performance */
.will-animate {
    will-change: transform, opacity;
}

/* Better mobile text readability */
@media (max-width: 640px) {
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
}

/* Enhanced mobile modal handling */
@media (max-width: 640px) {
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        border-radius: 0.75rem;
    }
}
:root {
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;
    --primary-950: #1e1b4b;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

body {
    background-color: #0f172a;
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

.font-display {
    font-family: 'Space Grotesk', sans-serif;
}

/* Animations */
@keyframes float-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

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

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

.animate-fade-in {
    animation: fade-in 0.5s ease-out forwards;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.6); }
}

@keyframes shine {
    from { mask-position: 150%; -webkit-mask-position: 150%; }
    to { mask-position: -50%; -webkit-mask-position: -50%; }
}

/* Components */
.glass-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
}

.modal-backdrop {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.stat-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.subscription-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.subscription-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

/* Utilities */
.divider-gradient {
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    margin: 1rem 0;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

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

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Skeleton Loading */
.skeleton {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-glow {
    animation: glow-pulse 3s infinite;
}

.btn-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent);
    mask-image: linear-gradient(black, black);
    -webkit-mask-image: linear-gradient(black, black);
    mask-size: 200% 100%;
    -webkit-mask-size: 200% 100%;
    animation: shine 4s linear infinite;
    pointer-events: none;
}

/* Form Elements */
.input-neon {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.input-neon:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    outline: none;
}

/* Navbar & Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: all 0.3s ease;
}

.mobile-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.mobile-menu-link {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e2e8f0;
    transition: color 0.3s ease;
}

.mobile-menu-link:hover {
    color: var(--primary-400);
}

.brand-logo-text {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    letter-spacing: 0.1em;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-logo-tagline {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: #94a3b8;
    text-transform: uppercase;
    display: block;
    margin-top: -4px;
}
