/* ==========================================================================
   CloudSync - Premium Cloud Storage SaaS Template
   ========================================================================== */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================================================== */

:root {
    /* Colors - Cloud Blue Theme */
    --color-primary-50: #f0f9ff;
    --color-primary-100: #e0f2fe;
    --color-primary-200: #bae6fd;
    --color-primary-300: #7dd3fc;
    --color-primary-400: #38bdf8;
    --color-primary-500: #0ea5e9;
    --color-primary-600: #0284c7;
    --color-primary-700: #0369a1;
    --color-primary-800: #075985;
    --color-primary-900: #0c4a6e;

    --color-secondary-50: #eef2ff;
    --color-secondary-100: #e0e7ff;
    --color-secondary-200: #c7d2fe;
    --color-secondary-300: #a5b4fc;
    --color-secondary-400: #818cf8;
    --color-secondary-500: #6366f1;
    --color-secondary-600: #4f46e5;
    --color-secondary-700: #4338ca;
    --color-secondary-800: #3730a3;
    --color-secondary-900: #312e81;

    --color-accent-green: #10b981;
    --color-accent-purple: #8b5cf6;
    --color-accent-orange: #f59e0b;

    --color-neutral-50: #fafafa;
    --color-neutral-100: #f5f5f5;
    --color-neutral-200: #e5e5e5;
    --color-neutral-300: #d4d4d4;
    --color-neutral-400: #a3a3a3;
    --color-neutral-500: #737373;
    --color-neutral-600: #525252;
    --color-neutral-700: #404040;
    --color-neutral-800: #262626;
    --color-neutral-900: #171717;

    --color-white: #ffffff;
    --color-black: #000000;

    /* Typography Scale */
    --text-hero: clamp(3rem, 8vw, 6rem);
    --text-display: clamp(2.5rem, 5vw, 4rem);
    --text-h1: clamp(2rem, 4vw, 3rem);
    --text-h2: clamp(1.5rem, 3vw, 2.25rem);
    --text-h3: clamp(1.25rem, 2vw, 1.5rem);
    --text-body: 1rem;
    --text-small: 0.875rem;
    --text-xs: 0.75rem;

    /* Spacing Scale (8px base) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Cloud-specific effects */
    --glow-blue: 0 0 60px rgba(14, 165, 233, 0.3);
    --glow-purple: 0 0 60px rgba(99, 102, 241, 0.3);
    --glow-green: 0 0 40px rgba(16, 185, 129, 0.3);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: 800ms cubic-bezier(0.16, 1, 0.3, 1);

    /* Gradients */
    --gradient-cloud: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    --gradient-cloud-light: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
    --gradient-mesh: radial-gradient(at 40% 20%, rgba(14, 165, 233, 0.3) 0px, transparent 50%),
                      radial-gradient(at 80% 0%, rgba(99, 102, 241, 0.3) 0px, transparent 50%),
                      radial-gradient(at 0% 50%, rgba(16, 185, 129, 0.3) 0px, transparent 50%);
}

/* Dark mode colors */
.dark {
    --color-neutral-50: #171717;
    --color-neutral-100: #262626;
    --color-neutral-200: #404040;
    --color-neutral-300: #525252;
    --color-neutral-400: #737373;
    --color-neutral-500: #a3a3a3;
    --color-neutral-600: #d4d4d4;
    --color-neutral-700: #e5e5e5;
    --color-neutral-800: #f5f5f5;
    --color-neutral-900: #fafafa;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--text-body);
    line-height: 1.6;
    color: var(--color-neutral-900);
    background-color: var(--color-white);
    transition: background-color var(--transition-base), color var(--transition-base);
}

.dark body {
    background-color: #0a0a0a;
    color: var(--color-white);
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-neutral-100);
}

.dark ::-webkit-scrollbar-track {
    background: var(--color-neutral-900);
}

::-webkit-scrollbar-thumb {
    background: var(--color-neutral-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-neutral-500);
}

/* Focus states */
:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

/* Skip link */
.sr-only:not(:focus):not(:active) {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* ==========================================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-smooth),
                transform var(--transition-smooth);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all var(--transition-smooth);
}

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

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all var(--transition-smooth);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all var(--transition-smooth);
}

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

.reveal-blur {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    transition: all var(--transition-smooth);
}

.reveal-blur.active {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ==========================================================================
   HOVER ANIMATIONS
   ========================================================================== */

.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.hover-zoom {
    overflow: hidden;
}

.hover-zoom img {
    transition: transform var(--transition-slow);
}

.hover-zoom:hover img {
    transform: scale(1.05);
}

.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.hover-shine:hover::before {
    left: 100%;
}

/* ==========================================================================
   CONTINUOUS ANIMATIONS
   ========================================================================== */

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

.animate-float {
    animation: float 6s ease-in-out infinite;
}

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

.animate-float-slow {
    animation: float-slow 8s ease-in-out infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

.pulse-ring {
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

@keyframes sync-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-sync {
    animation: sync-rotate 3s linear infinite;
}

@keyframes upload-pulse {
    0%, 100% { opacity: 1; transform: translateY(0); }
    50% { opacity: 0.5; transform: translateY(-10px); }
}

.animate-upload {
    animation: upload-pulse 1.5s ease-in-out infinite;
}

@keyframes cloud-float {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(10px) translateY(-5px); }
    50% { transform: translateX(0) translateY(-10px); }
    75% { transform: translateX(-10px) translateY(-5px); }
}

.animate-cloud {
    animation: cloud-float 20s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    background-size: 1000px 100%;
    animation: shimmer 3s linear infinite;
}

/* ==========================================================================
   CLOUD-SPECIFIC ANIMATIONS
   ========================================================================== */

@keyframes storage-fill {
    0% { width: 0%; }
    100% { width: var(--storage-percent, 75%); }
}

.storage-bar {
    animation: storage-fill 2s ease-out forwards;
}

@keyframes sync-icon {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
}

.sync-icon {
    animation: sync-icon 2s ease-in-out infinite;
}

@keyframes file-upload {
    0% { transform: translateY(20px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(-20px); opacity: 0; }
}

.file-upload-animation {
    animation: file-upload 3s ease-in-out infinite;
}

/* ==========================================================================
   GLASS MORPHISM EFFECTS
   ========================================================================== */

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass {
    background: rgba(10, 10, 10, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.dark .glass-strong {
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   GRADIENT BACKGROUNDS
   ========================================================================== */

.bg-gradient-cloud {
    background: var(--gradient-cloud);
}

.bg-gradient-mesh {
    background: var(--gradient-mesh);
}

.bg-gradient-radial {
    background: radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.15), transparent 70%);
}

.dark .bg-gradient-radial {
    background: radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.1), transparent 70%);
}

.bg-grid {
    background-image:
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.dark .bg-grid {
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
}

/* ==========================================================================
   TEXT GRADIENTS
   ========================================================================== */

.text-gradient {
    background: var(--gradient-cloud);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-light {
    background: var(--gradient-cloud-light);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   GLOW EFFECTS
   ========================================================================== */

.glow-blue {
    box-shadow: var(--glow-blue);
}

.glow-purple {
    box-shadow: var(--glow-purple);
}

.glow-green {
    box-shadow: var(--glow-green);
}

/* ==========================================================================
   FLOATING UI MOCKUP
   ========================================================================== */

.floating-mockup {
    position: relative;
    animation: float 6s ease-in-out infinite;
}

.mockup-shadow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 20px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.2), transparent);
    filter: blur(10px);
}

/* ==========================================================================
   STORAGE VISUALIZATIONS
   ========================================================================== */

.storage-meter {
    position: relative;
    width: 100%;
    height: 8px;
    background: var(--color-neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.dark .storage-meter {
    background: var(--color-neutral-800);
}

.storage-meter-fill {
    height: 100%;
    background: var(--gradient-cloud);
    border-radius: var(--radius-full);
    transition: width 1s ease-out;
}

.storage-meter-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

/* ==========================================================================
   PLATFORM ICONS
   ========================================================================== */

.platform-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-xl);
    background: var(--color-neutral-100);
    transition: all var(--transition-base);
}

.dark .platform-icon {
    background: var(--color-neutral-800);
}

.platform-icon:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   SECURITY BADGES
   ========================================================================== */

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--color-neutral-50);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    font-size: var(--text-small);
    transition: all var(--transition-base);
}

.dark .security-badge {
    background: var(--color-neutral-900);
    border-color: var(--color-neutral-800);
}

.security-badge:hover {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* ==========================================================================
   FEATURE COMPARISON TABLE
   ========================================================================== */

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th {
    padding: var(--space-4);
    background: var(--color-neutral-50);
    border-bottom: 2px solid var(--color-neutral-200);
    font-weight: 600;
    text-align: left;
}

.dark .comparison-table th {
    background: var(--color-neutral-900);
    border-color: var(--color-neutral-800);
}

.comparison-table td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-neutral-200);
}

.dark .comparison-table td {
    border-color: var(--color-neutral-800);
}

.comparison-table tr:hover {
    background: var(--color-neutral-50);
}

.dark .comparison-table tr:hover {
    background: var(--color-neutral-900);
}

/* ==========================================================================
   PRICING CARDS
   ========================================================================== */

.pricing-card {
    position: relative;
    padding: var(--space-8);
    background: var(--color-white);
    border: 2px solid var(--color-neutral-200);
    border-radius: var(--radius-2xl);
    transition: all var(--transition-base);
}

.dark .pricing-card {
    background: var(--color-neutral-900);
    border-color: var(--color-neutral-800);
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.pricing-card.featured {
    border-color: var(--color-primary-500);
    box-shadow: var(--glow-blue);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-2) var(--space-4);
    background: var(--gradient-cloud);
    color: var(--color-white);
    font-size: var(--text-small);
    font-weight: 600;
    border-radius: var(--radius-full);
}

/* ==========================================================================
   SYNC STATUS INDICATORS
   ========================================================================== */

.sync-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-neutral-100);
    border-radius: var(--radius-full);
    font-size: var(--text-small);
}

.dark .sync-status {
    background: var(--color-neutral-800);
}

.sync-status.syncing {
    background: rgba(14, 165, 233, 0.1);
    color: var(--color-primary-600);
}

.sync-status.synced {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-accent-green);
}

.sync-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.sync-status.syncing .sync-status-dot {
    animation: pulse 2s ease-in-out infinite;
}

/* ==========================================================================
   FILE/FOLDER CARDS
   ========================================================================== */

.file-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--color-white);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.dark .file-card {
    background: var(--color-neutral-900);
    border-color: var(--color-neutral-800);
}

.file-card:hover {
    border-color: var(--color-primary-500);
    box-shadow: var(--shadow-md);
}

.file-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-neutral-100);
    border-radius: var(--radius-md);
}

.dark .file-icon {
    background: var(--color-neutral-800);
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

section {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

.animated {
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-blur {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    body {
        background: white;
        color: black;
    }

    nav, footer, .no-print {
        display: none;
    }

    a {
        text-decoration: underline;
    }

    .reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-blur {
        opacity: 1;
        transform: none;
    }
}
