* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Enhanced Loading Screen */
#loading-screen {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    border: 4px solid rgba(0, 245, 255, 0.1);
    border-top: 4px solid #00f5ff;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

@keyframes spin {
    0% { 
        transform: rotate(0deg);
        box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 245, 255, 0.5);
    }
    100% { 
        transform: rotate(360deg);
        box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
    }
}

/* Global text selection */
::selection {
    background: rgba(0, 245, 255, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background: rgba(0, 245, 255, 0.3);
    color: #ffffff;
}

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

::-webkit-scrollbar-track {
    background: rgba(26, 26, 46, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00f5ff, #b345ff);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #39ff14, #00f5ff);
}

/* Page content wrapper */
#page-container {
    min-height: 100vh;
    position: relative;
}

#content-wrap {
    min-height: calc(100vh - 80px); /* Account for nav height */
}

/* Ensure proper z-index layering */
.z-neg {
    z-index: -1;
}

/* Utility classes for the futuristic theme */
.text-neon-blue {
    color: #00f5ff;
}

.text-neon-purple {
    color: #b345ff;
}

.text-neon-green {
    color: #39ff14;
}

.border-neon-blue {
    border-color: #00f5ff;
}

.border-neon-purple {
    border-color: #b345ff;
}

.border-neon-green {
    border-color: #39ff14;
}

/* Enhanced focus states */
button:focus,
a:focus,
input:focus,
textarea:focus {
    outline: 2px solid #00f5ff;
    outline-offset: 2px;
}

/* Enhanced hover states for interactive elements */
.interactive-hover {
    transition: all 0.3s ease;
}

.interactive-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 245, 255, 0.2);
}

/* Loading states for dynamic content */
.loading-skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

/* Responsive design helpers */
@media (max-width: 768px) {
    .spinner {
        width: 60px;
        height: 60px;
        border-width: 3px;
    }
    
    body {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .spinner {
        width: 50px;
        height: 50px;
        border-width: 2px;
    }
}

/* Custom AI-themed cursors */
body {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="%2300f5ff" stroke-width="2" fill="rgba(0,245,255,0.1)"/><circle cx="12" cy="12" r="3" fill="%2300f5ff"/><path d="M12 2v4M12 18v4M22 12h-4M6 12H2" stroke="%2300f5ff" stroke-width="2"/></svg>') 12 12, auto;
}

/* AI processing cursor for interactive elements */
a, button, .interactive {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><rect x="2" y="8" width="4" height="8" fill="%2300f5ff" opacity="0.8"><animate attributeName="height" values="8;16;8" dur="1s" repeatCount="indefinite"/><animate attributeName="y" values="8;4;8" dur="1s" repeatCount="indefinite"/></rect><rect x="8" y="6" width="4" height="12" fill="%23b345ff" opacity="0.8"><animate attributeName="height" values="12;20;12" dur="1s" begin="0.2s" repeatCount="indefinite"/><animate attributeName="y" values="6;2;6" dur="1s" begin="0.2s" repeatCount="indefinite"/></rect><rect x="14" y="4" width="4" height="16" fill="%2339ff14" opacity="0.8"><animate attributeName="height" values="16;20;16" dur="1s" begin="0.4s" repeatCount="indefinite"/><animate attributeName="y" values="4;2;4" dur="1s" begin="0.4s" repeatCount="indefinite"/></rect><rect x="20" y="10" width="2" height="4" fill="%2300f5ff" opacity="0.6"><animate attributeName="height" values="4;8;4" dur="1s" begin="0.6s" repeatCount="indefinite"/><animate attributeName="y" values="10;8;10" dur="1s" begin="0.6s" repeatCount="indefinite"/></rect></svg>') 12 12, pointer;
}

/* Error detection cursor for code/error related elements */
code, pre, .error-related, .ai-analysis {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="%23ff4444" stroke-width="2" fill="rgba(255,68,68,0.1)"/><path d="M12 8v4l3 3" stroke="%23ff4444" stroke-width="2" stroke-linecap="round"/><circle cx="12" cy="12" r="2" fill="%2300f5ff"><animate attributeName="r" values="2;4;2" dur="2s" repeatCount="indefinite"/></circle><text x="12" y="7" text-anchor="middle" fill="%2300f5ff" font-size="6" font-family="monospace">AI</text></svg>') 12 12, auto;
}

/* Success/resolution cursor for CTA buttons */
.cyber-btn-primary, .btn-primary, .cta-button {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="%2339ff14" stroke-width="2" fill="rgba(57,255,20,0.1)"/><path d="M8 12l3 3 5-6" stroke="%2339ff14" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/><circle cx="12" cy="12" r="11" stroke="%2300f5ff" stroke-width="1" opacity="0.5"><animate attributeName="r" values="11;13;11" dur="2s" repeatCount="indefinite"/></circle></svg>') 12 12, pointer;
}

/* Neural network cursor for AI-related content */
.neural-bg, .ai-analysis, .holo-text {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="4" cy="4" r="2" fill="%2300f5ff" opacity="0.8"/><circle cx="20" cy="4" r="2" fill="%23b345ff" opacity="0.8"/><circle cx="4" cy="20" r="2" fill="%2339ff14" opacity="0.8"/><circle cx="20" cy="20" r="2" fill="%2300f5ff" opacity="0.8"/><circle cx="12" cy="12" r="3" fill="%2300f5ff"><animate attributeName="opacity" values="0.5;1;0.5" dur="2s" repeatCount="indefinite"/></circle><line x1="4" y1="4" x2="12" y2="12" stroke="%2300f5ff" stroke-width="1" opacity="0.6"/><line x1="20" y1="4" x2="12" y2="12" stroke="%23b345ff" stroke-width="1" opacity="0.6"/><line x1="4" y1="20" x2="12" y2="12" stroke="%2339ff14" stroke-width="1" opacity="0.6"/><line x1="20" y1="20" x2="12" y2="12" stroke="%2300f5ff" stroke-width="1" opacity="0.6"/></svg>') 12 12, auto;
}

/* Loading/processing cursor for counters and animations */
.counter-display, .loading, .processing {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8" stroke="%2300f5ff" stroke-width="2" opacity="0.3"/><path d="M12 4v8l4 4" stroke="%2300f5ff" stroke-width="2" stroke-linecap="round" transform-origin="12 12"><animateTransform attributeName="transform" type="rotate" values="0;360" dur="2s" repeatCount="indefinite"/></path><circle cx="12" cy="12" r="2" fill="%2300f5ff"/></svg>') 12 12, auto;
}

/* Terminal/code cursor for developer-focused content */
.font-mono, .terminal, .code-preview {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><rect x="2" y="3" width="20" height="18" rx="2" stroke="%2300f5ff" stroke-width="2" fill="rgba(0,0,0,0.8)"/><path d="M6 8l4 4-4 4" stroke="%2339ff14" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><rect x="12" y="15" width="6" height="2" fill="%2300f5ff"><animate attributeName="opacity" values="1;0;1" dur="1s" repeatCount="indefinite"/></rect></svg>') 12 12, text;
}

/* Crosshair cursor for precise targeting (debugging) */
.pricing-card:hover, .feature-card:hover {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="6" stroke="%2300f5ff" stroke-width="1" opacity="0.5"/><line x1="12" y1="2" x2="12" y2="6" stroke="%2300f5ff" stroke-width="2"/><line x1="12" y1="18" x2="12" y2="22" stroke="%2300f5ff" stroke-width="2"/><line x1="2" y1="12" x2="6" y2="12" stroke="%2300f5ff" stroke-width="2"/><line x1="18" y1="12" x2="22" y2="12" stroke="%2300f5ff" stroke-width="2"/><circle cx="12" cy="12" r="2" fill="%2300f5ff"/></svg>') 12 12, crosshair;
}

/* Text selection cursor for readable content */
p, span, h1, h2, h3, h4, h5, h6 {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><rect x="4" y="4" width="16" height="16" rx="2" stroke="%2300f5ff" stroke-width="1" opacity="0.3"/><line x1="7" y1="8" x2="17" y2="8" stroke="%2300f5ff" stroke-width="1"/><line x1="7" y1="12" x2="15" y2="12" stroke="%2300f5ff" stroke-width="1"/><line x1="7" y1="16" x2="13" y2="16" stroke="%2300f5ff" stroke-width="1"/><rect x="18" y="7" width="2" height="10" fill="%2300f5ff"><animate attributeName="opacity" values="1;0;1" dur="1s" repeatCount="indefinite"/></rect></svg>') 12 12, text;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
        border-top-color: #00f5ff;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    /* Disable animated cursors for users who prefer reduced motion */
    body, a, button, .interactive, code, pre, .cyber-btn-primary, .neural-bg, .counter-display {
        cursor: auto !important;
    }
}