/* ===================================
   LWS Documentation - Main Styles
   =================================== */

/* --- CSS Variables --- */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #14b8a6;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border: #e5e7eb;
    --gradient: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --gradient-subtle: linear-gradient(135deg, #f0f9ff 0%, #fae8ff 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--secondary));
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.nav-brand .logo {
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 0 80px;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-subtle);
    z-index: -1;
    opacity: 0.5;
}

.hero-background::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbitalPulse 8s ease-in-out infinite;
}

@keyframes orbitalPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.6;
    }
}

.hero-content {
    text-align: center;
    z-index: 1;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease-out;
}

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

.subtitle {
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-light);
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 20px auto 40px;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 60px;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.btn {
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-block;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.hero-code {
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-code pre {
    background: var(--bg-dark);
    color: #e5e7eb;
    padding: 30px;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: var(--shadow-lg);
}

.hero-code code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
}

.code-comment {
    color: #6b7280;
}

.code-command {
    color: #14b8a6;
    font-weight: 600;
}

/* --- Unified Platform Section --- */
.unified-platform {
    padding: 120px 0;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    position: relative;
    overflow: hidden;
}

.unified-platform::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    animation: pulseGlow 8s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.unified-platform .section-title,
.unified-platform .section-subtitle {
    color: white;
    position: relative;
    z-index: 1;
}

.unified-platform .section-subtitle {
    color: #94a3b8;
}

.platform-workflow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 40px;
    align-items: center;
    max-width: 1100px;
    margin: 60px auto;
    position: relative;
    z-index: 1;
}

.workflow-step {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.workflow-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.workflow-step:hover {
    transform: translateY(-10px) rotateX(5deg);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow:
        0 20px 60px rgba(99, 102, 241, 0.3),
        0 0 40px rgba(236, 72, 153, 0.2),
        inset 0 0 30px rgba(255, 255, 255, 0.05);
}

.workflow-step:hover::before {
    opacity: 1;
}

.step-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 10px 20px rgba(99, 102, 241, 0.3));
    animation: floatIcon 3s ease-in-out infinite;
}

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

.workflow-step:hover .step-icon {
    animation: spinFloat 0.6s ease-out;
}

@keyframes spinFloat {
    0% { transform: translateY(0) rotateY(0deg); }
    50% { transform: translateY(-15px) rotateY(180deg); }
    100% { transform: translateY(0) rotateY(360deg); }
}

.workflow-step h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.workflow-step p {
    color: #94a3b8;
    font-size: 1rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.code-snippet {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    position: relative;
    z-index: 1;
}

.code-snippet code {
    font-family: 'Fira Code', 'Courier New', monospace;
    color: #14b8a6;
    font-size: 0.9rem;
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.3);
}

.workflow-arrow {
    font-size: 2.5rem;
    color: rgba(99, 102, 241, 0.6);
    animation: slideArrow 2s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

@keyframes slideArrow {
    0%, 100% {
        transform: translateX(0px);
        opacity: 0.6;
    }
    50% {
        transform: translateX(10px);
        opacity: 1;
    }
}

.platform-example {
    max-width: 900px;
    margin: 80px auto 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.platform-example::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(99, 102, 241, 0.05) 50%,
        transparent 70%
    );
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

.platform-example h3 {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
    display: inline-block;
}

.platform-example h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    animation: expandLine 1.5s ease-out 0.5s forwards;
}

@keyframes expandLine {
    to { transform: scaleX(1); }
}

.platform-example pre {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 30px;
    overflow-x: auto;
    position: relative;
    z-index: 1;
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.3),
        0 10px 40px rgba(99, 102, 241, 0.1);
}

.platform-example code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #e5e7eb;
}

/* --- Stats Section --- */
.stats {
    padding: 60px 0;
    background: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    text-align: center;
}

.stat-item {
    position: relative;
    padding: 20px;
    transition: var(--transition);
}

.stat-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-item:hover::before {
    opacity: 0.1;
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
    transition: transform 0.3s ease;
}

.stat-item:hover .stat-number {
    transform: scale(1.15);
}

.stat-label {
    color: var(--text-light);
    font-size: 1rem;
    margin-top: 10px;
    position: relative;
}

/* --- Features Section --- */
.features {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 10px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 60px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.feature-card:hover .feature-icon {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 5px 15px rgba(99, 102, 241, 0.3));
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-light);
}

/* --- Quick Start Section --- */
.quickstart {
    padding: 100px 0;
    background: white;
}

.quickstart-steps {
    max-width: 800px;
    margin: 0 auto;
}

.step {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
}

.step-content h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.step-content pre {
    background: var(--bg-dark);
    color: #e5e7eb;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
}

.step-content code {
    font-family: 'Fira Code', 'Courier New', monospace;
}

/* --- Docs Section --- */
.docs-section {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.doc-card {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.doc-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient);
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.doc-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.doc-card:hover::after {
    opacity: 1;
}

.doc-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.doc-card:hover .doc-icon {
    transform: scale(1.2) translateY(-5px);
    filter: drop-shadow(0 10px 20px rgba(99, 102, 241, 0.4));
}

.doc-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text);
}

.doc-card p {
    color: var(--text-light);
}

/* --- Footer --- */
.footer {
    background: var(--bg-dark);
    color: #e5e7eb;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    font-size: 1.5rem;
    font-weight: 900;
}

.footer-brand p {
    color: #9ca3af;
    margin-top: 10px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-column h4 {
    margin-bottom: 15px;
    color: white;
}

.footer-column a {
    display: block;
    color: #9ca3af;
    text-decoration: none;
    margin-bottom: 10px;
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll-triggered animations */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.slide-in-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Staggered animation delays for grid items */
.feature-card:nth-child(1) { transition-delay: 0.1s; }
.feature-card:nth-child(2) { transition-delay: 0.2s; }
.feature-card:nth-child(3) { transition-delay: 0.3s; }
.feature-card:nth-child(4) { transition-delay: 0.4s; }
.feature-card:nth-child(5) { transition-delay: 0.5s; }
.feature-card:nth-child(6) { transition-delay: 0.6s; }
.feature-card:nth-child(7) { transition-delay: 0.7s; }
.feature-card:nth-child(8) { transition-delay: 0.8s; }

.doc-card:nth-child(1) { transition-delay: 0.1s; }
.doc-card:nth-child(2) { transition-delay: 0.2s; }
.doc-card:nth-child(3) { transition-delay: 0.3s; }
.doc-card:nth-child(4) { transition-delay: 0.4s; }
.doc-card:nth-child(5) { transition-delay: 0.5s; }
.doc-card:nth-child(6) { transition-delay: 0.6s; }

/* --- Responsive --- */
@media (max-width: 968px) {
    .platform-workflow {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .workflow-arrow {
        transform: rotate(90deg);
        animation: slideArrowVertical 2s ease-in-out infinite;
    }

    @keyframes slideArrowVertical {
        0%, 100% {
            transform: rotate(90deg) translateY(0px);
            opacity: 0.6;
        }
        50% {
            transform: rotate(90deg) translateY(10px);
            opacity: 1;
        }
    }

    .platform-example {
        padding: 30px 20px;
    }

    .platform-example pre {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .nav-links {
        gap: 15px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }

    .unified-platform {
        padding: 80px 0;
    }

    .workflow-step {
        padding: 30px 20px;
    }

    .step-icon {
        font-size: 3rem;
    }
}

@media (max-width: 640px) {
    .workflow-step h3 {
        font-size: 1.2rem;
    }

    .platform-example h3 {
        font-size: 1.1rem;
    }

    .platform-example code {
        font-size: 0.85rem;
    }
}
