/* ===================================================
   Nobregas Hosting - Dark Theme Styles
   Modern dark UI with blue brand accent
   =================================================== */

/* ---- Base & Reset ---- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #030712;
    color: #e5e7eb;
    overflow-x: hidden;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(59, 130, 246, 0.25); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(59, 130, 246, 0.45); }

/* ---- Selection ---- */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

/* ---- Particle Canvas ---- */
#particle-canvas {
    opacity: 0.6;
}

/* ---- Reveal Animations ---- */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.reveal-element:nth-child(2) { transition-delay: 0.1s; }
.reveal-element:nth-child(3) { transition-delay: 0.2s; }
.reveal-element:nth-child(4) { transition-delay: 0.3s; }
.reveal-element:nth-child(5) { transition-delay: 0.4s; }
.reveal-element:nth-child(6) { transition-delay: 0.5s; }

/* ---- Pricing Card Hover Lift ---- */
.pricing-card > div:last-child {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
}
.pricing-card:hover > div:last-child {
    transform: translateY(-8px);
}

/* ---- Nav Styles ---- */
#main-header.scrolled #main-nav {
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

#main-header.scrolled #main-nav > div {
    max-width: 72rem;
}

@media (min-width: 768px) {
    #main-header.scrolled #main-nav {
        margin: 0.5rem auto;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
        border-radius: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
}

/* ---- Glass Cards ---- */
.glass-dark {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- Gradient Text ---- */
.gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #818cf8 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---- Glow Effects ---- */
.glow-blue {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3),
                0 0 60px rgba(59, 130, 246, 0.1);
}

.glow-blue-hover:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4),
                0 0 80px rgba(59, 130, 246, 0.15);
}

/* ---- Button Ripple Effect ---- */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ---- Table Row Hover ---- */
table tbody tr {
    transition: background-color 0.2s ease;
}

/* ---- Mobile Menu Animation ---- */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease;
    opacity: 0;
}

#mobile-menu.open {
    max-height: 500px;
    opacity: 1;
}

#mobile-menu.hidden {
    display: none;
}

/* ---- Animated Noise Texture (subtle) ---- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.015;
    z-index: 1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ---- Smooth Link Transitions ---- */
a {
    transition: color 0.2s ease;
}

/* ---- Focus Visible ---- */
*:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Responsive Tweaks ---- */
@media (max-width: 640px) {
    .reveal-element {
        transform: translateY(20px);
    }
}

/* ---- Print Styles ---- */
@media print {
    body { background: #fff; color: #000; }
    #particle-canvas,
    #main-header,
    .fixed { display: none !important; }
    body::before { display: none; }
}

/* ============================================================
   Hosting Nav Dropdown
   ============================================================ */

/* The panel is positioned absolutely under the trigger button */
.nav-dropdown-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 272px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Show on parent hover or focus-within */
#hosting-nav-item:hover .nav-dropdown-panel,
#hosting-nav-item:focus-within .nav-dropdown-panel {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Rotate chevron on hover */
#hosting-nav-item:hover #hosting-chevron,
#hosting-nav-item:focus-within #hosting-chevron {
    transform: rotate(180deg);
    color: #60a5fa;
}

#hosting-chevron {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
}

/* Small triangle pointer at top of dropdown */
.nav-dropdown-panel::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: rgba(10, 15, 30, 0.97);
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    rotate: 45deg;
    border-radius: 2px 0 0 0;
}

/* ============================================================
   Mobile Hosting Accordion
   ============================================================ */

#mobile-hosting-items {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.38s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease;
}

#mobile-hosting-items.open {
    max-height: 320px;
    opacity: 1;
}

#mobile-hosting-chevron.rotated {
    transform: rotate(180deg);
    color: #60a5fa;
}

/* ============================================================
   Knowledge Base Styles
   ============================================================ */

/* ---- Article Content Prose ---- */
.kb-article-content {
    line-height: 1.85;
    font-size: 1rem;
    color: #d1d5db;
}

.kb-article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.kb-article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f3f4f6;
    margin: 1.5rem 0 0.5rem;
}

.kb-article-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e5e7eb;
    margin: 1.25rem 0 0.5rem;
}

.kb-article-content p {
    margin-bottom: 1rem;
}

.kb-article-content ul,
.kb-article-content ol {
    margin: 0.75rem 0 1rem 1.5rem;
    padding: 0;
}

.kb-article-content ul { list-style: disc; }
.kb-article-content ol { list-style: decimal; }

.kb-article-content li {
    margin-bottom: 0.35rem;
    padding-left: 0.25rem;
}

.kb-article-content a {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.kb-article-content a:hover {
    color: #93bbfd;
}

.kb-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 1.5rem 0;
    border: 1px solid rgba(255,255,255,0.05);
}

.kb-article-content blockquote {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid #3b82f6;
    background: rgba(59,130,246,0.05);
    border-radius: 0 0.75rem 0.75rem 0;
    color: #9ca3af;
    font-style: italic;
}

.kb-article-content pre {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 0.75rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #e5e7eb;
}

.kb-article-content code {
    font-size: 0.875em;
    background: rgba(255,255,255,0.06);
    padding: 0.15em 0.4em;
    border-radius: 0.35rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: #f9a8d4;
}

.kb-article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.kb-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
}

.kb-article-content th,
.kb-article-content td {
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255,255,255,0.06);
    text-align: left;
}

.kb-article-content th {
    background: rgba(255,255,255,0.03);
    font-weight: 600;
    color: #f3f4f6;
}

.kb-article-content hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 2rem 0;
}

/* ---- Line Clamp ---- */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Search Dropdown ---- */
#kb-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    margin-top: 0.5rem;
    background: rgba(10, 15, 30, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

/* ---- Rich Text Editor ---- */
.kb-editor:focus {
    outline: none;
}

.kb-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 0.5rem 0;
}

.kb-toolbar button:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.kb-toolbar button.active {
    background: rgba(59,130,246,0.2);
    color: #60a5fa;
}

/* ---- Error Console Modal ---- */
.kb-error-console {
    z-index: 9999;
}
