/* ============================================
   PatchHub Official Website - Main Stylesheet
   ============================================ */

/* CSS Variables */
:root {
    --primary-dark: #1a1a2e;
    --primary-mid: #16213e;
    --primary-accent: #0f3460;
    --blue: #3498db;
    --blue-light: #5dade2;
    --red: #e94560;
    --green: #2ecc71;
    --orange: #f39c12;
    --purple: #9b59b6;
    --teal: #1abc9c;
    --dark-bg: #0d1117;
    --code-bg: #1e1e1e;
    --gray-50: #F8FAFC;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-700: #334155;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --font-family: 'Inter', 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Navigation Bar
   ============================================ */
#mainNavbar {
    padding: 14px 0;
    transition: var(--transition);
    background: transparent;
    z-index: 1030;
}

#mainNavbar.scrolled {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
}

.navbar-brand {
    display: inline-flex !important;
    align-items: center !important;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff !important;
    letter-spacing: -0.5px;
    white-space: nowrap;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.brand-logo {
    width: 30px;
    height: 30px;
    margin-right: 8px;
    flex-shrink: 0;
    border-radius: 6px;
    transform: translateY(0) !important;
}

.brand-text {
}

.brand-icon {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    vertical-align: middle;
    background: url('../img/logo.png') no-repeat center / contain;
}


.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: var(--transition);
    margin: 0 2px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link-shroudx {
    color: #4A6CF7 !important;
    font-weight: 600 !important;
}
.nav-link-shroudx:hover {
    color: #6C63FF !important;
    background: rgba(74, 108, 247, 0.12) !important;
}

.btn-nav-cta {
    background: linear-gradient(135deg, var(--blue), #5dade2);
    color: #fff !important;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.35);
}

.btn-nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.5);
    color: #fff;
}

.navbar-toggler {
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 6px 10px;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-mid) 50%, var(--primary-accent) 100%);
    overflow: hidden;
    padding: 120px 0 80px;
}

.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero-particles .particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    animation: particleFloat 15s ease-in-out infinite;
}

.hero-particles .particle:nth-child(1) { width: 300px; height: 300px; top: -50px; left: -50px; }
.hero-particles .particle:nth-child(2) { width: 200px; height: 200px; bottom: 10%; right: -30px; animation-delay: 4s; }
.hero-particles .particle:nth-child(3) { width: 150px; height: 150px; top: 30%; left: 60%; animation-delay: 8s; }
.hero-particles .particle:nth-child(4) { width: 100px; height: 100px; bottom: 20%; left: 20%; animation-delay: 2s; }
.hero-particles .particle:nth-child(5) { width: 250px; height: 250px; top: 40%; right: 20%; animation-delay: 6s; }
.hero-particles .particle:nth-child(6) { width: 80px; height: 80px; top: 10%; right: 40%; animation-delay: 10s; }

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 1; }
    25% { transform: translate(40px, -30px) scale(1.05); }
    50% { transform: translate(-20px, -50px) scale(0.95); opacity: 0.6; }
    75% { transform: translate(30px, 20px) scale(1.03); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 28px;
    backdrop-filter: blur(10px);
}

.hero-badge i { color: var(--blue-light); }

.hero-title {
    font-size: clamp(2.5rem, 5.5vw, 4rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--blue-light), var(--blue), #74b9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
    margin-bottom: 36px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

.btn-hero-primary {
    background: linear-gradient(135deg, var(--blue), #5dade2);
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: 0 8px 30px rgba(52, 152, 219, 0.4);
    text-decoration: none;
}

.btn-hero-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 40px rgba(52, 152, 219, 0.55);
    color: #fff;
}

.btn-hero-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.25);
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    text-decoration: none;
}

.btn-hero-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
    transform: translateY(-3px);
}

.hero-free-note {
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: -10px;
    margin-bottom: 36px;
    letter-spacing: 0.3px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

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

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.75rem;
    animation: bounceDown 2s ease-in-out infinite;
    cursor: pointer;
    z-index: 1;
}

@keyframes bounceDown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ============================================
   Section Headers
   ============================================ */
.section-header { margin-bottom: 60px; }

.section-tag {
    display: inline-block;
    background: rgba(52, 152, 219, 0.08);
    color: var(--blue);
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.section-tag-light {
    background: rgba(52, 152, 219, 0.2);
    color: var(--blue-light);
}

.section-title {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.section-desc-free {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--green);
    font-weight: 600;
}

/* ============================================
   Features Section
   ============================================ */
.features-section {
    padding: 100px 0;
    background: var(--gray-50);
}

.feature-card {
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px;
    height: 100%;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--blue), var(--blue-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover::before { opacity: 1; }

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: color-mix(in srgb, var(--icon-color) 10%, transparent);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--icon-color);
    margin-bottom: 20px;
}

.feature-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.feature-tags {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.feature-tags li {
    font-size: 0.72rem;
    padding: 4px 12px;
    border-radius: 50px;
    background: var(--gray-100);
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   Flow Section
   ============================================ */
.flow-section {
    padding: 100px 0;
    background: #fff;
}

.flow-steps { max-width: 820px; margin: 0 auto; }

.flow-step {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
    position: relative;
}

.flow-step:last-child { margin-bottom: 0; }

.flow-step-number {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
    color: #fff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
    position: relative;
    z-index: 1;
}

.flow-step::after {
    content: '';
    position: absolute;
    top: 52px;
    left: 25px;
    width: 2px;
    height: calc(100% + 50px);
    background: linear-gradient(to bottom, var(--blue), var(--gray-200));
    z-index: 0;
}

.flow-step:last-child::after { display: none; }

.flow-step-content {
    flex: 1;
    padding-top: 6px;
}

.flow-step-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.flow-step-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
}

/* Code Block */
.code-block-wrapper {
    background: var(--code-bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 8px;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-lang {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.btn-copy.copied {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.4);
    color: var(--green);
}

.code-block-wrapper pre {
    margin: 0;
    padding: 20px 24px;
    overflow-x: auto;
}

.code-block-wrapper code {
    font-family: 'SF Mono', 'Fira Code', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
}

/* Publish Params */
.publish-params {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.param-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}

.param-item i {
    font-size: 1.1rem;
    color: var(--green);
    flex-shrink: 0;
}

.param-item span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

/* ============================================
   Code Snippets Section
   ============================================ */
.snippets-section {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0d1b2a 100%);
    position: relative;
}

.snippets-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l30 30-30 30L0 30z' fill='none' stroke='rgba(255,255,255,0.02)' stroke-width='1'/%3E%3C/svg%3E");
    pointer-events: none;
}

.snippet-card {
    background: var(--code-bg);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition);
    height: 100%;
}

.snippet-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(52, 152, 219, 0.3);
}

.snippet-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.snippet-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.snippet-title {
    flex: 1;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    margin-left: 6px;
}

.btn-copy-dark {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy-dark:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.snippet-card pre {
    margin: 0;
    padding: 18px 22px;
    overflow-x: auto;
    background: transparent !important;
}

.snippet-card code {
    font-family: 'SF Mono', 'Fira Code', 'Monaco', monospace;
    font-size: 0.8rem;
    line-height: 1.8;
}

/* ============================================
   Contact Section
   ============================================ */
.contact-section {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--gray-50) 0%, #fff 100%);
}

.contact-card {
    background: #fff;
    border-radius: 20px;
    padding: 36px 28px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.contact-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.contact-icon {
    width: 64px;
    height: 64px;
    background: color-mix(in srgb, var(--card-color) 10%, transparent);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--card-color);
    margin: 0 auto 20px;
}

.contact-card h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.contact-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.btn-contact {
    background: var(--gray-100);
    color: var(--text-primary);
    border: 1px solid var(--gray-200);
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-contact:hover {
    background: var(--gray-200);
    color: var(--text-primary);
}

.btn-copy-contact {
    cursor: pointer;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--dark-bg);
    padding: 40px 0;
    color: rgba(255, 255, 255, 0.5);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.footer-brand .brand-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
}

.footer-desc {
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.footer-copyright {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.25);
    margin-bottom: 0;
}

.footer-links {
    display: flex;
    gap: 24px;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.footer-links a:hover { color: #fff; }

.footer-icp {
    font-size: 0.75rem;
    margin-bottom: 0;
}

.footer-icp a {
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    transition: var(--transition);
}

.footer-icp a:hover { color: rgba(255, 255, 255, 0.6); }

/* ============================================
   Toast
   ============================================ */
.copy-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--primary-dark);
    color: #fff;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   Animations
   ============================================ */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll-triggered animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991.98px) {
    #mainNavbar {
        background: rgba(26, 26, 46, 0.95);
        backdrop-filter: blur(20px);
    }

    #mainNavbar .navbar-collapse {
        padding-top: 20px;
    }

    .navbar-nav .nav-link {
        padding: 12px 16px !important;
    }

    .btn-nav-cta {
        margin-top: 10px;
        text-align: center;
    }

    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }

    .stat-divider {
        width: 40px;
        height: 1px;
    }

    .flow-step::after { display: none; }

    .flow-step {
        flex-direction: column;
        gap: 16px;
    }

    .flow-step-number {
        width: 44px;
        height: 44px;
        font-size: 1rem;
        border-radius: 12px;
    }

    .footer-links {
        justify-content: flex-start;
        margin-top: 20px;
    }

    .footer-icp { text-align: left; }
}

@media (max-width: 575.98px) {
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        padding: 0 20px;
    }

    .btn-hero-primary,
    .btn-hero-outline {
        text-align: center;
    }
}
