/* CSS Variables - Adapted from Gaswallet Monorepo */
:root {
    /* Colors */
    --dark: #000000;
    --dark-light: #000000;
    --dark-light-2: #000000;
    --primary: #76adf0;
    --slide-border-2: #1b232a;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;

    /* Z-index layers */
    --z-preloader: 9999;
    --z-modal: 1000;
    --z-controls: 100;
    --z-top-layer: 2;
    --z-bg-layer: 1;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Remove tap highlight globally */
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Hide scrollbar for all browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    /* Disable zoom completely */
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

html::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

body {
    font-family: var(--font-sans);
    background-color: var(--dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    /* Hide scrollbar for all browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    /* Remove tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
    /* Disable zoom completely */
    touch-action: pan-y pan-x;
    -ms-touch-action: pan-y pan-x;
}

body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Main Content - Max width for very wide screens */
.main-content {
    max-width: 1420px;
    margin: 0 auto;
    background-color: var(--dark);
    opacity: 1;
    transition: opacity var(--transition-normal);
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0));
}

.main-content.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Preloader Styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: var(--z-preloader);
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-canvas {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}


/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.text-secondary {
    color: var(--text-secondary);
}

/* Responsive Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    font-size: clamp(1rem, 2vw, 1.125rem);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background-color: var(--primary);
    color: var(--text-primary);
}

::-moz-selection {
    background-color: var(--primary);
    color: var(--text-primary);
}

/* Viewport Wrapper */
.viewport-wrapper {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    overflow: auto;
    overflow-x: hidden;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    /* Prevent any transforms or transitions during rotation */
    transition: none !important;
    transform: none !important;
    /* Ensure proper scroll on mobile */
    -webkit-overflow-scrolling: touch;
}

.viewport-wrapper::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

/* Orientation Warning Overlay */
.orientation-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.orientation-message {
    text-align: center;
    padding: var(--spacing-2xl);
    max-width: 90%;
}

.orientation-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    animation: rotatePhone 2s ease-in-out infinite;
}

@keyframes rotatePhone {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(90deg);
    }
}

.orientation-text {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
    font-weight: 400;
}

/* Show overlay only in landscape on mobile */
@media (orientation: landscape) and (max-height: 768px) {
    .orientation-overlay {
        display: flex;
    }

    .viewport-wrapper {
        filter: blur(30px);
        pointer-events: none;
    }
}

/* Media Queries */
@media (max-width: 768px) {
    :root {
        --spacing-lg: 20px;
        --spacing-xl: 24px;
        --spacing-2xl: 32px;
        --spacing-3xl: 48px;
    }
}
