/**
 * Hostwebo Custom CSS
 * Animations, overrides, and supplementary styles
 *
 * @package Hostwebo
 */

/* ---------- Gradient Animation ---------- */
@keyframes gradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.animate-gradient {
    animation: gradient 3s linear infinite;
}

/* ---------- Details/Summary (FAQ) ---------- */
.hostwebo-details summary::-webkit-details-marker,
.hostwebo-details summary::marker {
    display: none;
    content: '';
}
.hostwebo-details summary {
    list-style: none;
}

/* ---------- Smooth scrolling ---------- */
html {
    scroll-behavior: smooth;
}

/* ---------- Link resets for Tailwind ---------- */
a.no-underline {
    text-decoration: none !important;
}

/* ---------- Selection ---------- */
::selection {
    background: #6366f1;
    color: #fff;
}

/* ---------- Scrollbar Styling (Dark Mode) ---------- */
.dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.dark ::-webkit-scrollbar-track {
    background: #0B0F19;
}
.dark ::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* ---------- Billing Toggle Active States ---------- */
#eco-billing-toggle button[data-billing].active-monthly,
#wp-billing-toggle button[data-billing].active-monthly {
    /* Handled via JS class toggle */
}

/* ---------- Plan Card unavailable state ---------- */
.adv-plan-card.unavailable {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}
.adv-plan-card.unavailable::after {
    content: attr(data-unavailable-text);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: #ef4444;
    background: rgba(255,255,255,0.7);
    border-radius: 1rem;
    z-index: 20;
}
.dark .adv-plan-card.unavailable::after {
    background: rgba(11,15,25,0.8);
    color: #f87171;
}

/* ---------- Transition for page loads ---------- */
main {
    animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive overflow fix ---------- */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* ---------- Dark mode icon visibility ---------- */
.dark .hostwebo-icon-sun { display: inline !important; }
.dark .hostwebo-icon-moon { display: none !important; }
html:not(.dark) .hostwebo-icon-sun { display: none !important; }
html:not(.dark) .hostwebo-icon-moon { display: inline !important; }

/* ---------- Print styles ---------- */
@media print {
    nav, footer, #hostwebo-dark-toggle { display: none !important; }
    .dark { background: #fff !important; color: #000 !important; }
}

/* ============================================================
   DOCS PORTAL — prose typography for `.hostwebo-doc-prose`
   Custom, framework-free typography so single-doc articles
   render consistently even when @tailwindcss/typography isn't
   loaded server-side. Mirrors the brand calm slate palette.
   ============================================================ */
.hostwebo-doc-prose {
    color: #334155; /* slate-700 */
    font-size: 16px;
    line-height: 1.7;
}
.dark .hostwebo-doc-prose { color: #cbd5e1; /* slate-300 */ }

.hostwebo-doc-prose > * + * { margin-top: 1rem; }

.hostwebo-doc-prose h2 {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: #0f172a; /* slate-900 */
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 6rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}
.dark .hostwebo-doc-prose h2 { color: #ffffff; border-color: #1e293b; }

.hostwebo-doc-prose h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    scroll-margin-top: 6rem;
}
.dark .hostwebo-doc-prose h3 { color: #ffffff; }

.hostwebo-doc-prose h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 1.25rem;
}
.dark .hostwebo-doc-prose h4 { color: #e2e8f0; }

.hostwebo-doc-prose p { margin: 0; }
.hostwebo-doc-prose strong { color: #0f172a; font-weight: 700; }
.dark .hostwebo-doc-prose strong { color: #ffffff; }

.hostwebo-doc-prose a {
    color: #4f46e5; /* indigo-600 */
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(79, 70, 229, 0.3);
    transition: all 0.15s;
}
.hostwebo-doc-prose a:hover {
    color: #4338ca;
    border-bottom-color: #4f46e5;
}
.dark .hostwebo-doc-prose a { color: #a5b4fc; border-bottom-color: rgba(165, 180, 252, 0.35); }
.dark .hostwebo-doc-prose a:hover { color: #c7d2fe; border-bottom-color: #a5b4fc; }

.hostwebo-doc-prose ul, .hostwebo-doc-prose ol {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}
.hostwebo-doc-prose ul { list-style: disc; }
.hostwebo-doc-prose ol { list-style: decimal; }
.hostwebo-doc-prose li { margin-top: 0.4rem; padding-left: 0.25rem; }
.hostwebo-doc-prose li::marker { color: #94a3b8; }

/* Inline code */
.hostwebo-doc-prose :not(pre) > code {
    background: #f1f5f9;
    color: #be123c; /* rose-700, contrast on slate-100 */
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
    font-size: 0.875em;
    font-family: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
    border: 1px solid #e2e8f0;
}
.dark .hostwebo-doc-prose :not(pre) > code {
    background: #1e293b;
    color: #fda4af;
    border-color: #334155;
}

/* Code blocks */
.hostwebo-doc-prose pre {
    background: #0f172a; /* slate-900 */
    color: #e2e8f0;
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    font-family: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
    border: 1px solid #1e293b;
    margin: 1.25rem 0;
}
.dark .hostwebo-doc-prose pre {
    background: #020617;
    border-color: #1e293b;
}
.hostwebo-doc-prose pre code {
    background: transparent;
    color: inherit;
    border: 0;
    padding: 0;
    font-size: inherit;
}

/* Blockquotes -- repurposed as "tip" admonitions */
.hostwebo-doc-prose blockquote {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid #4f46e5;
    background: linear-gradient(to right, rgba(238, 242, 255, 1), rgba(238, 242, 255, 0.3));
    color: #312e81;
    border-radius: 0 12px 12px 0;
    font-style: normal;
}
.hostwebo-doc-prose blockquote p { margin: 0; }
.dark .hostwebo-doc-prose blockquote {
    background: linear-gradient(to right, rgba(49, 46, 129, 0.2), rgba(49, 46, 129, 0));
    color: #c7d2fe;
    border-left-color: #818cf8;
}

/* Admonition utility blocks rendered via shortcode/div in content.
   Usage: <div class="hwd-callout hwd-callout-tip">…</div> */
.hwd-callout {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem 1rem 3.25rem;
    border-radius: 12px;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.6;
}
.hwd-callout::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 1rem;
    width: 1.25rem;
    height: 1.25rem;
    background-repeat: no-repeat;
    background-size: contain;
}
.hwd-callout-tip {
    background: #eef2ff;
    color: #312e81;
    border: 1px solid #c7d2fe;
}
.hwd-callout-tip::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 16v-4'/><path d='M12 8h.01'/></svg>");
}
.hwd-callout-warn {
    background: #fef3c7;
    color: #78350f;
    border: 1px solid #fde68a;
}
.hwd-callout-warn::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z'/><path d='M12 9v4'/><path d='M12 17h.01'/></svg>");
}
.hwd-callout-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.hwd-callout-success::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}
.hwd-callout-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.hwd-callout-danger::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>");
}
.dark .hwd-callout-tip     { background: rgba(67, 56, 202, 0.15); color: #c7d2fe; border-color: rgba(99, 102, 241, 0.3); }
.dark .hwd-callout-warn    { background: rgba(217, 119, 6, 0.15);  color: #fcd34d; border-color: rgba(245, 158, 11, 0.3); }
.dark .hwd-callout-success { background: rgba(5, 150, 105, 0.15);  color: #6ee7b7; border-color: rgba(16, 185, 129, 0.3); }
.dark .hwd-callout-danger  { background: rgba(220, 38, 38, 0.15);  color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }

/* Tables in docs */
.hostwebo-doc-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    overflow-x: auto;
    display: block;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
}
.dark .hostwebo-doc-prose table { border-color: #1e293b; }
.hostwebo-doc-prose thead { background: #f8fafc; }
.dark .hostwebo-doc-prose thead { background: #1e293b; }
.hostwebo-doc-prose th, .hostwebo-doc-prose td {
    padding: 0.65rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.dark .hostwebo-doc-prose th, .dark .hostwebo-doc-prose td { border-bottom-color: #1e293b; }
.hostwebo-doc-prose th {
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}
.dark .hostwebo-doc-prose th { color: #e2e8f0; }
.hostwebo-doc-prose tbody tr:last-child td { border-bottom: 0; }
.hostwebo-doc-prose tbody tr:hover td { background: rgba(238, 242, 255, 0.3); }
.dark .hostwebo-doc-prose tbody tr:hover td { background: rgba(49, 46, 129, 0.15); }

/* Horizontal rule */
.hostwebo-doc-prose hr {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    margin: 2rem 0;
}
.dark .hostwebo-doc-prose hr {
    background: linear-gradient(to right, transparent, #1e293b, transparent);
}

/* Images / figures */
.hostwebo-doc-prose img {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    margin: 1.25rem 0;
    max-width: 100%;
    height: auto;
}
.dark .hostwebo-doc-prose img { border-color: #1e293b; }

.hostwebo-doc-prose figure { margin: 1.25rem 0; }
.hostwebo-doc-prose figcaption {
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}
.dark .hostwebo-doc-prose figcaption { color: #94a3b8; }

/* Keyboard keys */
.hostwebo-doc-prose kbd {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 0 #cbd5e1;
    padding: 0.1rem 0.45rem;
    border-radius: 5px;
    font-size: 0.85em;
    font-family: ui-monospace, monospace;
    color: #1e293b;
}
.dark .hostwebo-doc-prose kbd {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 0 #334155;
    color: #f1f5f9;
}
