/**
 * DC QR CODES - Main Styles
 * Global styles, background, cursor, scrollbar, typography
 * Author: Denis Casian
 * https://qr.deniscasian.com
 */

/* ============================================
   CSS Variables / Design Tokens
   ============================================ */
:root {
    /* Primary Colors - Purple Theme */
    --primary-50: #faf5ff;
    --primary-100: #f3e8ff;
    --primary-200: #e9d5ff;
    --primary-300: #d8b4fe;
    --primary-400: #c084fc;
    --primary-500: #a855f7;
    --primary-600: #9333ea;
    --primary-700: #7c3aed;
    --primary-800: #6b21a8;
    --primary-900: #581c87;
    
    /* Neutral Colors */
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    --neutral-950: #0a0a0a;
    
    /* Background Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #1a1a24;
    --bg-card: rgba(30, 27, 75, 0.4);
    --bg-card-hover: rgba(30, 27, 75, 0.6);
    --bg-input: rgba(15, 15, 35, 0.6);
    
    /* Text Colors */
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;
    
    /* Accent Colors */
    --accent-success: #22c55e;
    --accent-success-light: rgba(34, 197, 94, 0.2);
    --accent-error: #ef4444;
    --accent-error-light: rgba(239, 68, 68, 0.2);
    --accent-warning: #f59e0b;
    --accent-warning-light: rgba(245, 158, 11, 0.2);
    --accent-info: #3b82f6;
    --accent-info-light: rgba(59, 130, 246, 0.2);
    
    /* Border Colors */
    --border-subtle: rgba(139, 92, 246, 0.1);
    --border-default: rgba(139, 92, 246, 0.2);
    --border-strong: rgba(139, 92, 246, 0.4);
    --border-accent: rgba(139, 92, 246, 0.6);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.3);
    --shadow-glow-strong: 0 0 60px rgba(139, 92, 246, 0.5);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #8b5cf6, #c084fc);
    --gradient-primary-hover: linear-gradient(135deg, #7c3aed, #a855f7);
    --gradient-text: linear-gradient(135deg, #c084fc, #8b5cf6, #a78bfa);
    --gradient-bg: linear-gradient(180deg, #1e1b4b 0%, #0f0f1a 50%, #000 100%);
    --gradient-card: linear-gradient(145deg, rgba(139, 92, 246, 0.1), rgba(30, 27, 75, 0.4));
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3rem;
    
    --leading-tight: 1.2;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
    
    /* Transitions */
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
    
    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;
    --z-cursor: 9999;
    
    /* Layout */
    --header-height: 64px;
    --max-width: 1200px;
    --max-width-content: 1000px;
    --sidebar-width: 320px;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

* {
    -webkit-user-select: none;
    user-select: none;
}

input,
textarea,
select,
[contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================
   Custom Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-primary-hover);
}

::-webkit-scrollbar-corner {
    background: var(--bg-primary);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-600) var(--bg-primary);
}

/* ============================================
   Custom Cursor (Desktop Only)
   ============================================ */
@media (min-width: 769px) and (hover: hover) {
    * {
        cursor: none !important;
    }
}

.cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--primary-400);
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-cursor);
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-smooth);
}

.cursor-dot.visible {
    opacity: 1;
}

.cursor-outline {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(139, 92, 246, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: calc(var(--z-cursor) - 1);
    transform: translate(-50%, -50%);
    transition: 
        width var(--duration-normal) var(--ease-smooth),
        height var(--duration-normal) var(--ease-smooth),
        border-color var(--duration-normal) var(--ease-smooth),
        background var(--duration-normal) var(--ease-smooth);
    opacity: 0;
}

.cursor-outline.visible {
    opacity: 1;
}

.cursor-outline.hover {
    width: 60px;
    height: 60px;
    border-color: var(--primary-400);
    background: rgba(139, 92, 246, 0.1);
}

.cursor-outline.clicking {
    transform: translate(-50%, -50%) scale(0.8);
}

.cursor-outline.hidden {
    opacity: 0;
}

@media (max-width: 768px), (hover: none) {
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
}

/* ============================================
   Background Effects
   ============================================ */
.bg-ambient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at 50% 0%,
        #1e1b4b 0%,
        #0f0f1a 40%,
        #000 100%
    );
    z-index: -3;
    pointer-events: none;
}

.mesh-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(at 15% 20%, rgba(139, 92, 246, 0.25) 0, transparent 50%),
        radial-gradient(at 85% 80%, rgba(192, 132, 252, 0.2) 0, transparent 50%),
        radial-gradient(at 50% 50%, rgba(124, 58, 237, 0.1) 0, transparent 60%);
}

.floating-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float-orb 20s infinite ease-in-out;
    will-change: transform;
}

.orb:nth-child(1) {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.6), transparent 70%);
    top: -10%;
    left: 5%;
    animation-duration: 25s;
}

.orb:nth-child(2) {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.5), transparent 70%);
    top: 50%;
    right: -5%;
    animation-delay: -5s;
    animation-duration: 22s;
}

.orb:nth-child(3) {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.45), transparent 70%);
    bottom: -5%;
    left: 30%;
    animation-delay: -10s;
    animation-duration: 28s;
}

.orb:nth-child(4) {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.4), transparent 70%);
    top: 30%;
    left: -10%;
    animation-delay: -15s;
    animation-duration: 30s;
}

@keyframes float-orb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -40px) scale(1.05);
    }
    50% {
        transform: translate(50px, -70px) scale(1.1);
    }
    75% {
        transform: translate(20px, -30px) scale(1.03);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .orb {
        animation: none;
    }
    
    .cursor-dot,
    .cursor-outline {
        transition: none;
    }
}

/* ============================================
   Typography Utilities
   ============================================ */
.text-gradient {
    background: linear-gradient(135deg, #fff, #a5a5a5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-purple {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-animated {
    background: linear-gradient(
        135deg,
        var(--primary-400),
        var(--primary-500),
        var(--primary-300),
        var(--primary-400)
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 5s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ============================================
   Selection Styles
   ============================================ */
::selection {
    background: rgba(139, 92, 246, 0.4);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(139, 92, 246, 0.4);
    color: var(--text-primary);
}

/* ============================================
   Focus Styles
   ============================================ */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* ============================================
   Link Styles
   ============================================ */
a {
    color: var(--primary-400);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-smooth);
}

a:hover {
    color: var(--primary-300);
}

/* ============================================
   Image Defaults
   ============================================ */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

/* ============================================
   Form Element Defaults
   ============================================ */
button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

/* ============================================
   Utility Classes
   ============================================ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-col {
    flex-direction: column;
}

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   Page Layout
   ============================================ */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

.main-content {
    flex: 1;
    padding: calc(var(--header-height) + var(--space-xl)) var(--space-lg) var(--space-2xl);
    overflow-x: hidden;
}

.content-wrapper {
    width: 100%;
    max-width: var(--max-width-content);
    margin: 0 auto;
}

.content-wrapper-wide {
    max-width: var(--max-width);
}

/* ============================================
   Loading States
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-default);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .bg-ambient,
    .mesh-gradient,
    .floating-orbs,
    .cursor-dot,
    .cursor-outline,
    .sticky-header,
    .site-footer,
    .ad-container {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .glass-card {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
    }
}