/* =========================================
   WooLogger Header Styles
   Optimized & Modular
   ========================================= */

/* 1. CSS CUSTOM PROPERTIES */
:root {
    --c-bg: #fff;
    --c-surface: #fff;
    --c-surface-alt: #f9fafb;
    --c-text: #111827;
    --c-text-muted: #6b7280;
    --c-border: #e5e7eb;
    --c-success: #10b981;
    --c-error: #ef4444;
    --c-info: #3b82f6;
    --c-warning: #eab308;
    --c-verified: #1d9bf0;
    --c-white: #fff;
    --c-black: #000;
    --c-error-light: rgba(239, 68, 68, 0.1);
    --c-error-medium: rgba(239, 68, 68, 0.2);
    --c-success-light: rgba(16, 185, 129, 0.1);
    --c-info-light: rgba(59, 130, 246, 0.1);
    --c-warning-light: rgba(234, 179, 8, 0.1);
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-6: 1.5rem;
    --sp-8: 2rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --text-xs: 0.6875rem;
    --text-sm: 0.75rem;
    --text-base: 0.8125rem;
    --container-lg: 1216px;
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-overlay: 900;
    --z-modal: 1000;
    --z-header: 1001;
    --z-tooltip: 1100;
    --input-height-sm: 28px;
    --input-height-md: 36px;
    --input-height-lg: 44px;
    --bp-desktop: 1441px;
    --bp-tablet: 1024px;
    --bp-mobile: 768px;
    --bp-mobile-sm: 480px;
}

/* 2. CSS RESET */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-block-start: 54px;
}

a {
    color: inherit;
    text-decoration: none;
}

img, video, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: transparent;
}

input, textarea, select {
    font: inherit;
}

:focus-visible {
    outline: 2px solid var(--c-text);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

/* 3. UTILITIES */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: var(--container-lg);
    margin-inline: auto;
    padding-inline: var(--sp-4);
}

.py-16 {
    padding-block: 4rem;
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--c-text-muted);
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
}

article h1, aside h1, nav h1, section h1 {
    font-size: 2rem;
}

.prose {
    line-height: 1.75;
}

.prose p {
    margin-block-end: 1.25rem;
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-block: 2rem 1rem;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-block: 1.5rem 0.75rem;
}

.prose ul, .prose ol {
    margin-block-end: 1.25rem;
    padding-inline-start: 1.5rem;
}

.prose li {
    margin-block-end: var(--sp-2);
}

.prose a {
    color: var(--c-text);
    text-decoration: underline;
}

.prose img {
    border-radius: var(--radius-md);
    margin-block: 1.5rem;
}

/* Error Page */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-content {
    text-align: center;
}

.error-header {
    margin-bottom: var(--sp-6);
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--c-text-muted);
    margin-bottom: var(--sp-4);
}

.error-actions {
    display: flex;
    gap: var(--sp-3);
    justify-content: center;
    margin-top: var(--sp-6);
}

/* 4. HEADER BAR */
.site-header {
    position: fixed;
    top: var(--sp-3);
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1100px;
    z-index: var(--z-header);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-4);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

/* 5. LOGO */
.logo {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--c-text);
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--c-text);
    color: var(--c-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

/* 6. NAVIGATION */
.header-nav {
    display: flex;
    gap: var(--sp-6);
}

.header-nav a {
    color: var(--c-text-muted);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.header-nav a:hover {
    color: var(--c-text);
}

/* 7. ICON BUTTONS */
.icon-btn, .avatar-btn, .menu-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--c-text);
    transition: background var(--transition-fast);
}

.icon-btn:hover, .avatar-btn:hover {
    background: var(--c-surface-alt);
}

.avatar-btn img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Menu Toggle (Hamburger) */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--c-text);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 8. VISIBILITY UTILITIES */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: flex !important;
}

/* 9. BACKDROP */
.overlay-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    visibility: hidden;
    display: none;
    transition: all var(--transition-normal);
}

.overlay-backdrop.active {
    opacity: 1;
    visibility: visible;
    display: block;
}

/* 10. DRAWERS (Mobile Menu & Profile) */
.drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    background: var(--c-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: var(--z-modal);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition-slow), opacity var(--transition-normal), visibility var(--transition-normal);
    overflow-y: auto;
}

.drawer.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.drawer-handle {
    padding: var(--sp-3) 0;
    display: flex;
    justify-content: center;
    cursor: grab;
}

.drawer-handle::before {
    content: '';
    width: 40px;
    height: 5px;
    background: var(--c-border);
    border-radius: 3px;
}

.drawer-content {
    padding: 0 var(--sp-4) var(--sp-6);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.drawer-nav a {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3);
    color: var(--c-text);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.drawer-nav a:hover {
    background: var(--c-surface-alt);
}

.drawer-nav a svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.drawer-nav a.nav-logout {
    color: var(--c-error);
}

.drawer-header {
    display: flex;
    justify-content: center;
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--c-border);
}

.drawer-footer {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--c-border);
}

/* 11. PROFILE CARD */
.profile-card {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3);
    background: var(--c-surface-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
}

.profile-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
}

.profile-name {
    font-weight: 700;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-email {
    font-size: 0.875rem;
    color: var(--c-text-muted);
}

/* 12. CTA BUTTON */
.btn-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-3) var(--sp-4);
    background: var(--c-text);
    color: var(--c-bg);
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: opacity var(--transition-fast);
}

.btn-cta:hover {
    opacity: 0.9;
}

/* 13. SEARCH OVERLAY */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.search-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 100%;
    max-width: 600px;
    padding: 0 var(--sp-4);
}

.search-box {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4);
    background: var(--c-surface);
    border: 2px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.search-box svg {
    color: var(--c-text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--c-text);
    outline: none;
}

.search-box button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--c-text-muted);
    padding: var(--sp-1);
}

.search-results {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    margin-top: var(--sp-4);
}

.search-results:empty {
    display: none;
}

.search-results-item {
    display: flex;
    gap: var(--sp-4);
    padding: var(--sp-4);
    border-bottom: 1px solid var(--c-border);
    cursor: pointer;
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-2);
    transition: all var(--transition-fast);
}

.search-results-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.search-results-item:hover {
    background: var(--c-surface-alt);
    transform: translateX(4px);
}

.search-results-item img {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.search-results-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 var(--sp-2);
}

.search-results-item p {
    font-size: 0.875rem;
    color: var(--c-text-muted);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-empty, .search-results-empty, .search-results-loading {
    padding: calc(var(--sp-8) * 1.25) var(--sp-4);
    text-align: center;
    color: var(--c-text-muted);
}

/* 14. FRONT PAGE HERO */
body.home,
body.home #main,
body.home .site-wrapper {
    margin: 0;
    padding: 0;
    max-width: none;
    width: 100%;
}

@media (min-width: 992px) {
    body.home .site-header {
        position: absolute;
        width: 100%;
        top: 0;
        z-index: 100;
        background: transparent !important;
        border: none !important;
    }
}

.integration-hero-wrapper {
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.integration-hero {
    position: relative;
    padding: 120px 0 60px;
    font-family: var(--font-sans);
    color: #1e293b;
    width: 100%;
}

.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: 1;
    pointer-events: none;
}

.hero-container {
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: center;
    padding: 0 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.hero-title {
    font-size: clamp(32px, 7vw, 64px);
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a;
    margin: 0 0 24px;
    letter-spacing: -2px;
}

.hero-subtitle {
    font-size: clamp(16px, 1.8vw, 20px);
    color: #64748b;
    line-height: 1.6;
    margin: 0 auto 40px;
    max-width: 700px;
}

.hero-btn {
    background: #0f172a;
    color: #fff;
    border: 0;
    padding: 18px 40px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

.hero-btn:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.2);
}

.icon-carousel-wrap {
    margin-top: 80px;
    position: relative;
    padding: 20px 0;
    overflow: hidden;
    width: 100vw;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.icon-row {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
    width: max-content;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.icon-card {
    width: 70px;
    height: 70px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f1f5f9;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-card:hover {
    transform: scale(1.15) translate3d(0, 0, 0);
    z-index: 10;
    border-color: #3b82f6;
    box-shadow: 0 15px 30px -5px rgba(59, 130, 246, 0.2);
}

.icon-card svg {
    width: 34px;
    height: 34px;
}

.scroll-left { animation: scrollL 50s linear infinite; }
.scroll-right { animation: scrollR 50s linear infinite; }

@keyframes scrollL {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes scrollR {
    0% { transform: translate3d(-50%, 0, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

.fade-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    pointer-events: none;
    z-index: 5;
}

.fade-overlay.left {
    left: 0;
    background: linear-gradient(to right, #f8fafc, transparent);
}

.fade-overlay.right {
    right: 0;
    background: linear-gradient(to left, #f8fafc, transparent);
}

/* 15. RESPONSIVE */
@media (min-width: 1025px) {
    .site-header .drawer {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .header-nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .site-header .mobile-only {
        display: flex;
    }

    .site-header .desktop-only {
        display: none;
    }

    .header-left .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .header-left .logo span {
        display: none;
    }
}

@media (max-width: 768px) {
    .site-header {
        width: 95%;
        top: var(--sp-2);
    }

    .header-inner {
        padding: var(--sp-2) var(--sp-3);
    }

    .icon-btn, .avatar-btn, .menu-toggle {
        width: 36px;
        height: 36px;
    }

    .search-results {
        max-height: 50vh;
    }

    .container {
        padding-inline: var(--sp-3);
    }

    .integration-hero {
        padding: 40px 0;
    }

    .hero-title {
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .site-header {
        width: 98%;
    }

    .header-inner {
        padding: var(--sp-2);
    }

    .icon-btn, .avatar-btn, .menu-toggle {
        width: 32px;
        height: 32px;
    }

    .hero-title {
        font-size: clamp(28px, 6vw, 36px);
    }
    
    .icon-card {
        width: 56px;
        height: 56px;
    }
    
    .icon-card svg {
        width: 28px;
        height: 28px;
    }
}
