/* ============================================
   SHARED STYLES - Main CSS File
   ============================================ */

/* CSS Variables */
:root {
    /* Light theme colors */
    --bg-primary: #F4F2EE;
    --bg-secondary: rgba(255, 255, 255, 0.4);
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-white: #ffffff;
    --accent-primary: #D946EF;
    --accent-hover: #C026D3;
    --border-color: rgba(0, 0, 0, 0.1);
    --border-dark: rgba(0, 0, 0, 0.12);
    --shadow-light: rgba(0, 0, 0, 0.06);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.4);
    --grain-texture: rgba(26, 26, 26, 0.04);
}

[data-theme="dark"] {
    /* Dark theme colors */
    --bg-primary: #0f0f0f;
    --bg-secondary: rgba(26, 26, 26, 0.4);
    --text-primary: #f4f2ee;
    --text-secondary: #9ca3af;
    --text-white: #ffffff;
    --accent-primary: #D946EF;
    --accent-hover: #E879F9;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-dark: rgba(255, 255, 255, 0.12);
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(26, 26, 26, 0.4);
    --grain-texture: rgba(244, 242, 238, 0.02);
}

/* Base Styles */
body {
    background-color: var(--bg-primary);
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    max-width: 100vw;
    position: relative;
}

html {
    overflow-x: hidden;
    max-width: 100vw;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Grain Texture */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXVpaWl0dHTg4ODs7OzT09PW1tbPz8+urq6ioqKpqamgp6eAgIB+fn5xcXGenp5XV1eZmZlSUlKDg4OHh4fNewUHAAAAEXRSTlMAARk28gT29/Dy9fLz8/P39/d2fBUwAAAA2UlEQVRIx+3MyQEAIAwD0c5/2s3gDyAhezQAQG62t73/vV8xRVVVBEEQBEG2RFVVEf2n6lIUVRVEQRAEQVAMVRVEURR9pylRFVVEURAEQRAMISoqoir6T1GkKiqiqggCIAiCIB5RVURVFP2nKVAVVURVEYqi6EdV9J+iCFVRFWVReBv9pylQFVVRlUWg7/a/b982hKuqirIoy5b/2n+kKqqiLIsi71dVVfmfA3E/z1AzwA4A0N63uTslRRVVRVEQBEHyA03bBGRd4cQwAAAAAElFTkSuQmCC');
    opacity: var(--grain-texture);
    pointer-events: none;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Syne', sans-serif;
}

/* Custom Cursor - Only on desktop */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: none;
    }
    
    .cursor {
        position: fixed;
        border-radius: 50%;
        pointer-events: none;
        z-index: 10001;
        mix-blend-mode: difference;
        transition: transform 0.2s ease-out, opacity 0.3s ease-out;
        transform: translate(-50%, -50%);
        will-change: transform;
    }

    .cursor-dot {
        width: 8px;
        height: 8px;
        background: var(--text-white);
    }

    .cursor-outline {
        width: 40px;
        height: 40px;
        border: 1px solid var(--text-white);
    }
}

/* Hide cursor on mobile */
@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }
    
    .cursor {
        display: none;
    }
}

/* Utility Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Loading Skeleton */
.loading-skeleton {
    background: linear-gradient(90deg, var(--glass-bg) 25%, var(--bg-secondary) 50%, var(--glass-bg) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Glass Effect */
.glass-bg {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

/* Button Styles */
.btn-enhanced {
    position: relative;
    overflow: hidden;
    transform: perspective(1px) translateZ(0);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.btn-enhanced:hover::before {
    width: 300px;
    height: 300px;
}

.btn-enhanced:active {
    transform: scale(0.98);
}

/* Glow Effect */
.glow-on-hover {
    position: relative;
    transition: all 0.3s ease;
}

.glow-on-hover::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-hover));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    filter: blur(8px);
}

.glow-on-hover:hover::after {
    opacity: 0.7;
}

/* Text Animations */
.text-shimmer {
    background: linear-gradient(
        90deg,
        var(--text-primary) 0%,
        var(--accent-primary) 50%,
        var(--text-primary) 100%
    );
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 200% 50%; }
    50% { background-position: -200% 50%; }
}

/* Floating Animation */
.float {
    animation: float 6s ease-in-out infinite;
}

.float:nth-child(odd) {
    animation-delay: -2s;
}

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

/* Card Hover Effects */
.card-hover {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .magnetic-item {
        min-height: 44px;
        min-width: 44px;
    }

    .magnetic-item:hover {
        transform: none !important;
    }

    * {
        max-width: 100vw;
    }
}
