/* =============================================================================
   AdServerX — Public Site Styles
   Bootstrap 5.3 base; custom properties handle light/dark theming.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Custom properties
   --------------------------------------------------------------------------- */
:root {
    --hero-bg: #f0f4ff;
    --hero-gradient: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    --feature-icon-bg: #dbeafe;
    --feature-icon-color: #2563eb;
    --section-alt-bg: #e8f0fe;
    --pricing-highlight-border: #0d6efd;
    --pricing-highlight-bg: #f0f6ff;
    --card-hover-shadow: 0 8px 24px rgba(0,0,0,.10);
    --nav-border: rgba(0,0,0,.08);
    --footer-bg: #111827;
    --footer-color: #9ca3af;
    --footer-link-color: #d1d5db;
    --footer-link-hover: #ffffff;
    --code-bg: #1e293b;
    --code-color: #7dd3fc;
}

[data-bs-theme="dark"] {
    --hero-bg: #0d1117;
    --hero-gradient: linear-gradient(135deg, #0d1117 0%, #0f172a 100%);
    --feature-icon-bg: #1e3a5f;
    --feature-icon-color: #60a5fa;
    --section-alt-bg: #161b22;
    --pricing-highlight-bg: #0d1f40;
    --card-hover-shadow: 0 8px 24px rgba(0,0,0,.40);
    --nav-border: rgba(255,255,255,.08);
    --footer-bg: #0d1117;
    --footer-color: #6b7280;
    --footer-link-color: #9ca3af;
    --footer-link-hover: #e5e7eb;
}

/* ---------------------------------------------------------------------------
   Global
   --------------------------------------------------------------------------- */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* ---------------------------------------------------------------------------
   Navbar
   --------------------------------------------------------------------------- */
.site-navbar {
    border-bottom: 1px solid var(--nav-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.site-brand {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: inherit;
}

.site-brand span {
    color: #0d6efd;
}

.site-brand:hover {
    color: inherit;
}

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */
.hero-section {
    background: var(--hero-gradient);
    padding: 5rem 0 4rem;
}

.hero-section .hero-badge {
    display: inline-block;
    padding: .25rem .75rem;
    background: rgba(13, 110, 253, .1);
    color: #0d6efd;
    border-radius: 50px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

[data-bs-theme="dark"] .hero-section .hero-badge {
    background: rgba(96, 165, 250, .15);
    color: #60a5fa;
}

.hero-section h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
}

.hero-section .lead {
    font-size: 1.15rem;
    max-width: 560px;
}

.hero-code-box {
    background: var(--code-bg);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: .875rem;
    color: var(--code-color);
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.hero-code-box .code-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.hero-code-box .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.hero-code-box .dot-red   { background: #ff5f57; }
.hero-code-box .dot-yellow { background: #ffbd2e; }
.hero-code-box .dot-green  { background: #28c940; }

.hero-code-box .code-line {
    display: block;
    line-height: 1.8;
    white-space: nowrap;
}

.hero-code-box .code-comment { color: #6b7280; }
.hero-code-box .code-keyword { color: #c084fc; }
.hero-code-box .code-string  { color: #86efac; }
.hero-code-box .code-number  { color: #fbbf24; }

/* ---------------------------------------------------------------------------
   Features section
   --------------------------------------------------------------------------- */
.features-section {
    padding: 5rem 0;
}

.feature-icon {
    width: 52px;
    height: 52px;
    background: var(--feature-icon-bg);
    color: var(--feature-icon-color);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    margin-bottom: 1rem;
}

.feature-card {
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    transition: box-shadow .2s, transform .2s;
    height: 100%;
}

.feature-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-2px);
}

/* ---------------------------------------------------------------------------
   Stats / social proof section
   --------------------------------------------------------------------------- */
.stats-section {
    background: var(--section-alt-bg);
    padding: 3.5rem 0;
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    color: #0d6efd;
}

/* ---------------------------------------------------------------------------
   Pricing
   --------------------------------------------------------------------------- */
.pricing-section {
    padding: 5rem 0;
}

.pricing-card {
    border-radius: 14px;
    transition: box-shadow .2s, transform .2s;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-3px);
}

.pricing-card.highlighted {
    border-color: var(--pricing-highlight-border) !important;
    border-width: 2px !important;
    background: var(--pricing-highlight-bg);
}

.pricing-card .popular-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #0d6efd;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: .3rem .8rem;
    border-bottom-left-radius: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1;
}

.pricing-price sup {
    font-size: 1.2rem;
    font-weight: 600;
    vertical-align: super;
    letter-spacing: 0;
}

.pricing-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pricing-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .3rem 0;
    font-size: .9rem;
}

.pricing-feature-list .fa-check {
    color: #22c55e;
    margin-top: .15rem;
    flex-shrink: 0;
}

/* Mobile: bottom border between stacked pricing panels */
@media (max-width: 767.98px) {
    .pricing-left-panel {
        border-bottom: 1px solid rgba(0,0,0,.1);
    }
    [data-bs-theme="dark"] .pricing-left-panel {
        border-bottom-color: rgba(255,255,255,.1);
    }
}

/* ---------------------------------------------------------------------------
   Service cards (Additional Services on /pricing)
   --------------------------------------------------------------------------- */
.service-card {
    transition: box-shadow .2s, transform .2s;
    border: 1px solid rgba(0,0,0,.08);
}

[data-bs-theme="dark"] .service-card {
    border-color: rgba(255,255,255,.2);
}

.service-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-3px);
}

.service-card-accent {
    height: 4px;
    background: linear-gradient(90deg, #0d6efd 0%, #6d28d9 100%);
}

.service-icon-wrap {
    width: 44px;
    height: 44px;
    background: var(--feature-icon-bg);
    color: var(--feature-icon-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.service-card-desc {
    font-size: .875rem;
    color: var(--bs-secondary-color);
}

.service-card-desc ul,
.service-card-desc ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-card-desc li {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    padding: .2rem 0;
}

.service-card-desc li .fa-check {
    color: #22c55e;
    margin-top: .18rem;
    flex-shrink: 0;
}

.service-price {
    display: flex;
    align-items: baseline;
    gap: .1rem;
    line-height: 1;
}

.service-price-currency {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.service-price-amount {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.service-price-label {
    font-size: .75rem;
    color: var(--bs-secondary-color);
    margin-top: .1rem;
}

.service-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    margin-top: auto;
    border-top: 1px solid rgba(0,0,0,.07);
}

[data-bs-theme="dark"] .service-card-footer {
    border-top-color: rgba(255,255,255,.07);
}

/* ---------------------------------------------------------------------------
   CTA section
   --------------------------------------------------------------------------- */
.cta-section {
    background: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
    padding: 5rem 0;
    color: #fff;
}

/* ---------------------------------------------------------------------------
   Section headings
   --------------------------------------------------------------------------- */
.section-heading {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.section-subheading {
    font-size: 1.05rem;
    max-width: 660px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------------------------------------------------------------------------
   Blog
   --------------------------------------------------------------------------- */
.blog-card {
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    height: 100%;
}

.blog-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-2px);
}

.blog-card .card-img-top {
    height: 180px;
    object-fit: cover;
    background: var(--feature-icon-bg);
}

.blog-card .blog-img-placeholder {
    height: 180px;
    background: var(--feature-icon-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--feature-icon-color);
    font-size: 2rem;
}

/* ---------------------------------------------------------------------------
   Docs
   --------------------------------------------------------------------------- */
.docs-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.docs-nav .nav-link {
    padding: .3rem .75rem;
    font-size: .9rem;
    border-radius: 6px;
    color: inherit;
}

.docs-nav .nav-link:hover,
.docs-nav .nav-link.active {
    background: var(--feature-icon-bg);
    color: var(--feature-icon-color);
}

.docs-nav .nav-children {
    padding-left: 1rem;
    border-left: 2px solid var(--nav-border);
    margin-left: .75rem;
    margin-top: .25rem;
    display: none;
}

.docs-nav .nav-children.open {
    display: block;
}

.docs-nav-group-header {
    display: flex;
    align-items: center;
}

.docs-nav-group-header .nav-link {
    flex: 1;
}

.docs-nav-toggle {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: .25rem .4rem;
    color: var(--bs-secondary-color);
    cursor: pointer;
    line-height: 1;
    border-radius: 4px;
    transition: color .15s;
}

.docs-nav-toggle:hover {
    color: var(--bs-body-color);
}

.docs-nav-toggle i {
    font-size: .7rem;
    transition: transform .2s ease;
}

.docs-nav-toggle[aria-expanded="true"] i {
    transform: rotate(90deg);
}

.docs-content {
    min-height: 60vh;
}

.docs-content h1, .docs-content h2, .docs-content h3 {
    margin-top: 2rem;
    margin-bottom: .75rem;
}

.docs-content pre {
    background: var(--code-bg);
    color: var(--code-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
}

/* ---------------------------------------------------------------------------
   Changelog
   --------------------------------------------------------------------------- */
.changelog-section {
    padding: 3rem 0;
}

.changelog-entry {
    position: relative;
    padding-left: 2.5rem;
    padding-bottom: 2.5rem;
}

.changelog-entry::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--nav-border);
}

.changelog-entry:last-child::before {
    display: none;
}

.changelog-dot {
    position: absolute;
    left: 0;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0d6efd;
    border: 3px solid var(--bs-body-bg);
    box-shadow: 0 0 0 2px #0d6efd;
}

.changelog-version {
    font-weight: 700;
    font-size: 1.1rem;
}

.changelog-date {
    font-size: .85rem;
    color: var(--bs-secondary-color);
}

/* ---------------------------------------------------------------------------
   FAQ
   --------------------------------------------------------------------------- */
.faq-section {
    padding: 4rem 0;
}

/* ---------------------------------------------------------------------------
   Contact
   --------------------------------------------------------------------------- */
.contact-section {
    padding: 4rem 0;
}

/* ---------------------------------------------------------------------------
   Legal pages
   --------------------------------------------------------------------------- */
.legal-content {
    max-width: 780px;
    margin: 0 auto;
    padding: 3rem 0;
}

.legal-content h2 {
    margin-top: 2.5rem;
    margin-bottom: .75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.legal-content h3 {
    margin-top: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-color);
    padding: 3.5rem 0 2rem;
    margin-top: auto;
}

.site-footer a {
    color: var(--footer-link-color);
    text-decoration: none;
    font-size: .9rem;
    transition: color .15s;
}

.site-footer a:hover {
    color: var(--footer-link-hover);
}

.footer-brand {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
}

.footer-brand span {
    color: #60a5fa;
}

.footer-divider {
    border-color: rgba(255,255,255,.1);
}

.footer-col-heading {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: .5rem;
}

/* ---------------------------------------------------------------------------
   Cookie consent banner
   --------------------------------------------------------------------------- */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1080;
    border-top: 1px solid var(--nav-border);
    padding: .875rem 0;
}

/* ---------------------------------------------------------------------------
   Utility
   --------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 5rem 1rem;
    color: var(--bs-secondary-color);
}

.empty-state .empty-icon {
    font-size: 3rem;
    opacity: .4;
    margin-bottom: 1rem;
}

/* Checkmark list — icon stays fixed, text wraps under itself */
.check-list li {
    display: flex;
    align-items: flex-start;
}

.check-list li > i:first-child {
    flex-shrink: 0;
    margin-top: .2em;
}

.text-gradient {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 2.5rem;
        text-align: center;
    }

    .hero-section .lead {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-section .d-flex {
        justify-content: center;
    }

    .hero-code-box {
        margin-top: 2rem;
    }

    .pricing-section .row > [class*="col-"] {
        margin-bottom: 1rem;
    }
}

/* =============================================================================
   Customer Portal
   ============================================================================= */

:root {
    --sidebar-bg: #f8f9fa;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;
    --sidebar-border: rgba(0,0,0,.07);
    --topbar-height: 56px;
    --topbar-bg: var(--bs-body-bg);
    --topbar-border: rgba(0,0,0,.07);
    --portal-content-bg: var(--bs-body-bg);
}

[data-bs-theme="dark"] {
    --sidebar-bg: #12131a;
    --sidebar-border: rgba(255,255,255,.06);
    --topbar-border: rgba(255,255,255,.06);
}

/* Layout shell */
.portal-body {
    background: var(--portal-content-bg);
    min-height: 100vh;
}

.portal-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.portal-sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease;
}

/* Sidebar collapsed state */
[data-sidebar-collapsed="1"] .portal-sidebar {
    width: var(--sidebar-collapsed-width);
    overflow-x: hidden;
}

[data-sidebar-collapsed="1"] .portal-sidebar .nav-label {
    display: none !important;
}

[data-sidebar-collapsed="1"] .portal-sidebar .portal-nav .nav-link {
    justify-content: center;
    gap: 0;
}

[data-sidebar-collapsed="1"] .portal-sidebar .portal-brand {
    justify-content: center;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

/* Sidebar toggle button */
.sidebar-toggle-btn {
    background: none;
    border: none;
    color: var(--bs-secondary-color);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.sidebar-toggle-btn:hover {
    color: var(--bs-body-color);
    background: rgba(var(--bs-secondary-rgb), 0.1);
}

.portal-brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    border-bottom: 1px solid var(--sidebar-border);
}

.portal-brand-sm {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Sidebar nav */
.portal-nav .nav-link {
    color: var(--bs-body-color);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
    transition: background .15s, color .15s;
}

.portal-nav .nav-link:hover {
    background: rgba(var(--bs-primary-rgb), .08);
    color: var(--bs-primary);
}

.portal-nav .nav-link.active {
    background: var(--bs-primary);
    color: #fff !important;
}

[data-bs-theme="dark"] .portal-nav .nav-link.active {
    background: var(--bs-primary);
    color: #fff !important;
}

/* Offcanvas sidebar on mobile */
.portal-offcanvas .portal-nav .nav-link {
    color: var(--bs-body-color);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
}

.portal-offcanvas .portal-nav .nav-link:hover {
    background: rgba(var(--bs-primary-rgb), .08);
    color: var(--bs-primary);
}

.portal-offcanvas .portal-nav .nav-link.active {
    background: var(--bs-primary);
    color: #fff !important;
}

/* Main content area */
.portal-main {
    min-height: 100vh;
    overflow-x: hidden;
}

/* Top bar */
.portal-topbar {
    height: var(--topbar-height);
    border-bottom: 1px solid var(--topbar-border);
    background: var(--topbar-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 0.5rem;
}

.portal-content {
    max-width: 100%;
}

/* Getting started checklist */
.checklist-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.checklist-step + .checklist-step {
    border-top: 1px solid var(--bs-border-color);
}

.checklist-step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.checklist-step-icon.done {
    background: #198754;
    color: #fff;
}

.checklist-step-icon.pending {
    background: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    border: 2px solid var(--bs-border-color);
}

/* License key reveal */
.license-key-masked {
    font-family: monospace;
    letter-spacing: 0.05em;
    font-size: 0.95rem;
}

/* Ticket thread */
.ticket-message {
    max-width: 85%;
}

.ticket-message.customer {
    margin-right: auto;
}

.ticket-message.admin {
    margin-left: auto;
}

.ticket-message .message-bubble {
    border-radius: 12px;
    padding: 0.75rem 1rem;
}

.ticket-message.customer .message-bubble {
    background: var(--bs-secondary-bg);
    border-bottom-left-radius: 3px;
}

.ticket-message.admin .message-bubble {
    background: rgba(var(--bs-primary-rgb), .1);
    border-bottom-right-radius: 3px;
}

/* Download table */
.download-row td {
    vertical-align: middle;
}

/* Portal stat card */
.portal-stat-card {
    border-radius: 12px;
    padding: 1.25rem;
}

.portal-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

/* Responsive: collapse sidebar on mobile */
@media (max-width: 991.98px) {
    .portal-wrapper {
        flex-direction: column;
    }

    .portal-sidebar {
        display: none !important;
    }

    .portal-main {
        min-height: 100vh;
    }
}

@media (max-width: 575.98px) {
    /* Tighter topbar padding on small screens */
    .portal-topbar {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Admin filter bars: stack vertically, full-width inputs */
    .portal-content .d-flex.gap-2.flex-wrap .form-control,
    .portal-content .d-flex.gap-2.flex-wrap .form-select {
        width: 100% !important;
    }
}

/* Logo theme switching */
[data-bs-theme="dark"] .logo-light { display: none; }
[data-bs-theme="light"] .logo-dark { display: none; }
