/* ═══════════════════════════════════════════════════════════════════════════
   DESELT - Site Styles
   Performance & Mobile Optimized
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { 
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape on iOS */
}
body { 
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #0A1628;
    line-height: 1.5;
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

/* ── Typography ───────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { 
    font-family: "IBM Plex Sans", sans-serif; 
    font-weight: 700;
    line-height: 1.2;
}
.orbitron { font-family: "Orbitron", sans-serif; }
code, pre { font-family: "IBM Plex Mono", monospace; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.mud-layout { min-height: 100vh; display: flex; flex-direction: column; }
.mud-main-content { flex: 1; display: flex; flex-direction: column; }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.mud-appbar { height: 64px !important; box-shadow: 0 1px 0 #E2E8F0 !important; }
.mud-main-content { padding-top: 64px !important; }

.nav-link-btn { border-radius: 0 !important; }
.nav-link-btn:hover { color: #0A1628 !important; background: rgba(10,22,40,0.05) !important; }

/* ── Cards & Interactive Elements ─────────────────────────────────────────── */
.service-card { 
    transition: all 0.2s ease-out; 
    cursor: pointer;
    /* Hardware acceleration for smooth animations */
    transform: translateZ(0);
    will-change: transform;
}
.service-card:hover { 
    border-color: #0F52BA !important; 
    transform: translateY(-3px); 
    box-shadow: 0 8px 32px rgba(15,82,186,0.1) !important; 
}

.feature-card { 
    transition: all 0.2s ease-out;
    transform: translateZ(0);
}
.feature-card:hover { 
    background: rgba(255,255,255,0.06) !important; 
    border-color: rgba(0,212,255,0.2) !important; 
}

.pricing-card { 
    transition: transform 0.2s ease-out;
    transform: translateZ(0);
}
.pricing-card:hover { transform: translateY(-3px); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer-link { transition: color 0.15s ease-out; }
.footer-link:hover { color: rgba(255,255,255,0.85) !important; }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #F4F6F9; }
::-webkit-scrollbar-thumb { background: #0F52BA; border-radius: 3px; }

/* Firefox scrollbar */
html {
    scrollbar-width: thin;
    scrollbar-color: #0F52BA #F4F6F9;
}

/* ── Blazor Error UI ──────────────────────────────────────────────────────── */
#blazor-error-ui { 
    background: #FEF3C7; 
    bottom: 0; 
    display: none; 
    left: 0; 
    padding: 0.6rem 1.25rem; 
    position: fixed; 
    width: 100%; 
    z-index: 1000; 
    font-size: 14px; 
    color: #92400E; 
}
#blazor-error-ui .dismiss { 
    cursor: pointer; 
    position: absolute; 
    right: 0.75rem; 
    top: 0.5rem; 
}

/* ── Section Transitions ──────────────────────────────────────────────────── */
section { transition: background 0.3s ease-out; }

/* ── Focus States (Accessibility) ─────────────────────────────────────────── */
*:focus:not(:focus-visible) {
    outline: none !important;
}

*:focus-visible {
    outline: 2px solid #0F52BA !important;
    outline-offset: 2px;
}

.mud-container *:focus:not(:focus-visible),
section:focus,
h1:focus, h2:focus, h3:focus {
    outline: none !important;
}

/* ── Buttons & Links ──────────────────────────────────────────────────────── */
a, button {
    touch-action: manipulation; /* Faster tap response on mobile */
}

/* Minimum touch target size (44x44px per WCAG) */
@media (pointer: coarse) {
    a, button, .clickable {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ── Images ───────────────────────────────────────────────────────────────── */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lazy loading placeholder */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE STYLES
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Mobile: Small phones (up to 480px) ───────────────────────────────────── */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    section {
        padding: 48px 0 !important;
    }
    
    .mud-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    
    /* Stack buttons on mobile */
    .button-group {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .button-group a, .button-group button {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ── Mobile: Standard phones (481px - 768px) ──────────────────────────────── */
@media (max-width: 768px) {
    /* Reduce padding on mobile */
    section {
        padding: 56px 0 !important;
    }
    
    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }
    
    /* Full width cards on mobile */
    .mud-grid-item {
        padding: 8px !important;
    }
    
    /* Improve tap targets */
    .mud-button {
        min-height: 48px;
        padding: 12px 20px !important;
    }
    
    /* Better spacing for mobile forms */
    input, textarea, select {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
}

/* ── Tablet (769px - 1024px) ──────────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
    .mud-container {
        max-width: 95% !important;
    }
}

/* ── Desktop (1025px+) ────────────────────────────────────────────────────── */
@media (min-width: 1025px) {
    /* Show desktop-only elements */
    .mobile-only {
        display: none !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   PERFORMANCE OPTIMIZATIONS
   ══════════════════════════════════════════════════════════════════════════ */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode */
    /* 
    :root {
        --bg-primary: #0A1628;
        --text-primary: #FFFFFF;
    }
    */
}

/* Print styles */
@media print {
    .mud-appbar,
    .mud-drawer,
    #blazor-error-ui,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   LOADING STATES
   ══════════════════════════════════════════════════════════════════════════ */

/* Skeleton loading animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* Page loading indicator */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 22, 40, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #00D4FF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
