@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

:root {
    --bg-root: #050505;
    --bg-panel: #0a0a0a;
    --border-color: rgba(255, 255, 255, 0.08);
    --accent: #3b82f6;
    --text-main: #ededed;
    --text-dim: #888888;
    --text-inv: #000000;
}

[data-theme="light"] {
    --bg-root: #f3f4f6;
    --bg-panel: #ffffff;
    --border-color: rgba(0, 0, 0, 0.1);
    --accent: #2563eb;
    --text-main: #1f2937;
    --text-dim: #6b7280;
    --text-inv: #ffffff;
}

body {
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-main);
    background: var(--bg-root);
    transition: background-color 0.3s, color 0.3s;
}

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

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

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.material-icons {
    vertical-align: middle;
}

.sidebar-link.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border-right: 2px solid var(--accent);
}

.card {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.glass {
    background: rgba(10, 10, 10, 0.8);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
}

[data-theme="light"] .glass {
    background: rgba(255, 255, 255, 0.8);
}

.brand-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    color: white;
    background: var(--accent);
    transition: all 0.2s ease;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.brand-button:hover {
    background: #2563eb;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    color: var(--text-dim);
    border: 1px solid var(--border-color);
    background: transparent;
    transition: all 0.2s ease;
}

.ghost-button:hover {
    color: var(--text-main);
    border-color: var(--text-main);
}

/* Hero and divider banners */
.hero-banner {
    background-image: url('https://databaseimgberry.edgeone.app/berry_86.webp');
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, var(--bg-root));
}

.banner-overlay {
    background: rgba(5, 5, 5, 0.7);
}

.divider-banner {
    background-image: url('https://databaseimgberry.edgeone.app/berry_140.webp');
    background-size: cover;
    background-position: center;
    filter: grayscale(100%);
    opacity: 0.4;
}

/* Utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile Specific Styles */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.will-change-transform {
    will-change: transform;
}

.tab-btn.active {
    background-color: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
}

/* Ensure mobile hero dots are visible */
#dotsContainer span {
    transition: all 0.3s ease;
}

/* Force hide/show utilities for JS switching */
@media (max-width: 768px) {
    .hero-banner {
        display: none !important;
        /* Force hide desktop banner on mobile */
    }

    /* Prevent FOUC on mobile load */
    #mobile-hero-container {
        min-height: 250px;
        /* Placeholder height to prevent layout shift */
        background: #0f172a;
        /* Dark placeholder bg */
        border-radius: 1rem;
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 769px) {
    #mobile-hero-container {
        display: none !important;
        /* Force hide mobile container on desktop */
    }
}

/* --- ANIMATIONS --- */

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    /* Start hidden */
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Float */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

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

/* Pulse Glow (Blue) */
@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
    }

    50% {
        box-shadow: 0 0 25px rgba(59, 130, 246, 0.6);
    }
}

.animate-pulse-glow {
    animation: pulseGlow 3s infinite;
}

@keyframes pulseSlow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.animate-pulse-slow {
    animation: pulseSlow 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes glitchText {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(0);
    }
}

.hover-glitch:hover {
    animation: glitchText 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: var(--accent);
}

/* Typewriter Effect */
@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--accent)
    }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent);
    animation:
        typing 3.5s steps(40, end),
        blink-caret .75s step-end infinite;
    display: inline-block;
    max-width: fit-content;
}

/* Scanline Effect */
.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.1) 50%,
            rgba(0, 0, 0, 0.1));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 5;
    opacity: 0.3;
}

/* --- PREMIUM HERO TYPOGRAPHY & INTERACTION --- */
.font-sans-premium {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.hero-headline {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-banner:hover .hero-headline {
    transform: translateY(-4px);
}

.hero-subhead {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

.hero-btn-primary {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.6);
}

.hero-btn-primary:active {
    transform: scale(0.95);
    box-shadow: 0 5px 15px -5px rgba(59, 130, 246, 0.4);
}

.hero-btn-secondary {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-btn-secondary:hover {
    background-color: rgba(30, 41, 59, 0.6);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

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

/* --- SEARCH ENGINE UI --- */
.search-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: rgba(15, 19, 36, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8);
    z-index: 1001;
    overflow: hidden;
    animation: slideInDown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-suggestions.active {
    display: block;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.suggestion-item span.icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-root);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.suggestion-item .name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

.suggestion-item .dev {
    font-size: 10px;
    color: var(--text-dim);
}

.ai-advice-box {
    padding: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ai-advice-icon {
    color: var(--accent);
    font-size: 16px !important;
    animation: float 3s ease-in-out infinite;
}

.ai-advice-text {
    font-size: 11px;
    color: var(--text-main);
    line-height: 1.5;
    font-style: italic;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Headbar Search Input */
.headbar-search-container {
    display: none;
    align-items: center;
    position: relative;
    max-width: 300px;
    width: 100%;
}

@media (min-width: 1024px) {
    .headbar-search-container {
        display: flex;
    }
}

.headbar-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px 6px 36px;
    font-size: 13px;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.headbar-search-input:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    width: 320px;
}

.headbar-search-icon {
    position: absolute;
    left: 10px;
    font-size: 16px !important;
    color: var(--text-dim);
    pointer-events: none;
}