/* ============================================
   Vectronix Frontend - Dual Accent Enterprise
   Vue 3 + Tailwind CSS
   Accent-1: Blue #3b82f6 | Accent-2: Amber #f59e0b
   ============================================ */

/* ============================================
   Base Overrides & Utilities
   ============================================ */
[v-cloak] { display: none; }
html { scroll-behavior: smooth; }

/* ============================================
   Category Panel (Products Sidebar)
   ============================================ */

/* Glass-morphism panel */
.category-panel-glass {
    position: sticky;
    top: 6rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.5);
    box-shadow:
        0 4px 24px -4px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

/* Enhanced category item with hover indicator */
.category-item-enhanced {
    position: relative;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.category-item-enhanced::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    transform: scaleY(0);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.category-item-enhanced:hover::before {
    transform: scaleY(1);
}
.category-item-enhanced:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(226, 232, 240, 0.4), transparent);
}

/* Children expand/collapse animation (grid trick) */
.category-children-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.category-children-wrapper.expanded {
    grid-template-rows: 1fr;
}
.category-children-wrapper > div {
    min-height: 0;
}

/* Tree connector lines for child categories */
.category-child-item {
    position: relative;
}
.category-child-item::before {
    content: '';
    position: absolute;
    left: 1.625rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(226, 232, 240, 0.6);
}
.category-child-item::after {
    content: '';
    position: absolute;
    left: 1.625rem;
    top: 50%;
    width: 10px;
    height: 1px;
    background: rgba(226, 232, 240, 0.6);
}
.category-child-item:last-child::before {
    bottom: 50%;
}

/* Scroll fade hint at bottom */
.category-list-fade {
    position: relative;
}
.category-list-fade::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.5rem;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.85));
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.category-list-fade.has-scroll::after {
    opacity: 1;
}

/* Mobile horizontal category scroll bar */
.category-scroll-bar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.category-scroll-bar::-webkit-scrollbar {
    display: none;
}
.category-chip {
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}
.category-chip:active {
    transform: scale(0.95);
}

/* Category list scrollbar */
.category-list::-webkit-scrollbar { width: 4px; }
.category-list::-webkit-scrollbar-track { background: transparent; }
.category-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.category-list::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================
   Scroll-triggered Reveal Animations
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0) !important;
}
.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }

/* ============================================
   Page Hero Banner (inner pages)
   ============================================ */
.page-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
    padding: 3.5rem 0 3rem;
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.015) 10px,
        rgba(255, 255, 255, 0.015) 20px
    );
    pointer-events: none;
}
.page-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3b82f6 30%, #f59e0b 70%, transparent);
}
.page-hero .hero-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.07;
    pointer-events: none;
}

/* ============================================
   Card hover: left accent border slide-in
   ============================================ */
.card-hover {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}
.card-hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    transform: scaleY(0);
    transition: transform 0.25s ease;
    z-index: 1;
}
.card-hover:hover::before {
    transform: scaleY(1);
}
.card-hover:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    transform: translateY(-4px);
    border-color: rgba(226, 232, 240, 0.3);
}
.card-hover:active {
    transform: translateY(-2px) scale(0.99);
}

/* Card variant: top accent bar */
.card-feature {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}
.card-feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #f59e0b);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}
.card-feature:hover::before {
    transform: scaleX(1);
}
.card-feature:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    transform: translateY(-4px);
    border-color: rgba(226, 232, 240, 0.3);
}

/* ============================================
   Section accent bar (under section titles)
   ============================================ */
.section-accent-bar {
    width: 3rem;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #f59e0b, #3b82f6);
    background-size: 200% 100%;
    border-radius: 2px;
    margin: 0.75rem auto 0;
    animation: shimmer-bar 3s ease-in-out infinite;
}

@keyframes shimmer-bar {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================================
   Gradient button styles
   ============================================ */
.btn-amber {
    background: #f59e0b;
    color: #ffffff;
    transition: all 0.2s ease;
    position: relative;
}
.btn-amber:hover {
    background: #d97706;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.btn-amber:active {
    transform: translateY(0);
}

.btn-accent-gradient {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    transition: all 0.2s ease;
    position: relative;
}
.btn-accent-gradient:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}
.btn-accent-gradient:active {
    transform: translateY(0);
}

/* ============================================
   Image Hover Effects
   ============================================ */
.img-zoom {
    overflow: hidden;
}
.img-zoom img {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.img-zoom:hover img,
.card-hover:hover .img-zoom img,
.card-feature:hover .img-zoom img {
    transform: scale(1.05);
}

/* ============================================
   Product Detail Page
   ============================================ */
.product-main-image {
    position: relative;
    min-height: 280px;
}
.product-main-image:hover img {
    transform: scale(1.03);
}
.product-thumb {
    transition: all 0.2s ease;
}
.product-thumb:hover {
    transform: translateY(-2px);
}

/* Collapsible description */
.product-description--collapsed {
    max-height: 400px;
    overflow: hidden;
    position: relative;
}
.product-description--collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, white);
    pointer-events: none;
}

/* Description HTML content styling */
.product-description p {
    margin-bottom: 0.5em;
    line-height: 1.8;
}
.product-description img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}
.product-description h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}
.product-description iframe {
    max-width: 100%;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

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

/* ============================================
   Link Arrow Animation
   ============================================ */
.link-arrow i {
    transition: transform 0.25s ease;
}
.link-arrow:hover i {
    transform: translateX(4px);
}

/* ============================================
   Background Textures
   ============================================ */
.bg-dots {
    position: relative;
}
.bg-dots::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, #94a3b8 0.5px, transparent 0.5px);
    background-size: 24px 24px;
    opacity: 0.12;
    pointer-events: none;
}

.bg-grid {
    position: relative;
}
.bg-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.bg-grid-dark::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Section glow behind titles */
.section-glow {
    position: relative;
}
.section-glow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 200px;
    background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Wave Section Divider */
.section-divider-wave {
    height: 40px;
    background: transparent;
    position: relative;
    overflow: hidden;
}
.section-divider-wave::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20 Q300 0 600 20 T1200 20 V40 H0Z' fill='%23f0f5ff'/%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
}

.section-divider-wave-reverse {
    height: 40px;
    background: transparent;
    position: relative;
    overflow: hidden;
}
.section-divider-wave-reverse::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 20 Q300 40 600 20 T1200 20 V0 H0Z' fill='%23f0f5ff'/%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
}

/* ============================================
   Article rich content from CMS
   ============================================ */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
}
.article-content h2 { font-size: 1.375rem; }
.article-content h3 { font-size: 1.125rem; }
.article-content p { margin-bottom: 1rem; line-height: 1.75; }
.article-content ul, .article-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.article-content li { margin-bottom: 0.375rem; }
.article-content img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 1rem 0; }
.article-content a { color: #3b82f6; text-decoration: underline; }
.article-content a:hover { color: #1d4ed8; }
.article-content table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.article-content table th,
.article-content table td { padding: 0.5rem 0.75rem; border: 1px solid #e2e8f0; font-size: 0.875rem; }
.article-content table th { background: #f0f5ff; font-weight: 600; color: #1e293b; }

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   Spinner
   ============================================ */
.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Carousel
   ============================================ */
.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

/* ============================================
   Custom scrollbar
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #94a3b8, #64748b);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #64748b, #475569);
}

/* ============================================
   Focus ring
   ============================================ */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6;
}

/* ============================================
   Transitions
   ============================================ */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.2s ease;
}
.fade-enter-from, .fade-leave-to {
    opacity: 0;
}

/* ============================================
   Navbar active indicator
   ============================================ */
.nav-link-active {
    position: relative;
}
.nav-link-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(1);
    width: 70%;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #f59e0b);
    border-radius: 1px;
    transition: transform 0.25s ease;
}

/* ============================================
   Footer enhancements
   ============================================ */
.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1) 20%, rgba(59, 130, 246, 0.3) 50%, rgba(255, 255, 255, 0.1) 80%, transparent);
}

.social-icon {
    transition: all 0.25s ease;
}
.social-icon:hover {
    transform: scale(1.1) rotate(-5deg);
}
