/* CompareStack SaaS UI extensions */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hero premium */
.hero-premium {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    margin-top: 18px;
    background: linear-gradient(135deg, #04081d 0%, #0b1240 45%, #03071c 100%);
    color: #f8fafc;
}

.hero-shapes .hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.45;
    animation: heroFloat 12s ease-in-out infinite;
}

.hero-shape-1 {
    width: 280px;
    height: 280px;
    background: #2563eb;
    top: -80px;
    left: -40px;
}

.hero-shape-2 {
    width: 200px;
    height: 200px;
    background: #22c55e;
    top: 20%;
    right: 10%;
    animation-delay: -4s;
}

.hero-shape-3 {
    width: 160px;
    height: 160px;
    background: #3b82f6;
    bottom: -40px;
    left: 40%;
    animation-delay: -7s;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-16px) scale(1.05); }
}

.hero-premium-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
    padding: 48px 40px;
}

.hero-sub {
    color: #cbd5e1;
    font-size: 1.08rem;
    line-height: 1.6;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.hero-actions a {
    text-decoration: none;
}

.hero-actions a:hover,
.hero-actions a:focus,
.hero-actions a:visited {
    text-decoration: none;
}

.btn-lg {
    padding: 12px 22px;
    font-size: 1rem;
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.btn-outline:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.btn-ghost {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    display: inline-flex;
    margin: 0 16px 16px;
    font-size: 0.88rem;
}

.hero-mock {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}

.hero-mock-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.hero-mock-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
}

.hero-mock-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.hero-mock-pane {
    background: #0f172a;
    border-radius: 10px;
    padding: 12px;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.72rem;
    line-height: 1.5;
}

.hero-mock-pane code {
    display: block;
    color: #e2e8f0;
}

.hero-mock-pane-b .diff-line-add {
    color: #4ade80;
}

.hero-mock-caption {
    margin: 12px 0 0;
    text-align: center;
    font-size: 0.82rem;
    color: #94a3b8;
}

/* Tool search */
.tool-search-section {
    margin-top: 20px;
}

.tool-search-label {
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.tool-search-wrap {
    position: relative;
}

.tool-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1.1rem;
}

.tool-search-input {
    width: 100%;
    padding: 14px 14px 14px 42px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tool-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.tool-search-hint {
    margin: 8px 0 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.tool-search-results {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.tool-search-item {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tool-search-item:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.1);
}

.tool-search-item em {
    font-style: normal;
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 700;
}

.tool-search-empty {
    color: var(--muted);
    margin: 0;
}

/* Sections */
.section-block {
    margin: 28px 0;
    padding-bottom: 8px;
}

.blog-preview-section {
    margin-bottom: 40px;
    padding-bottom: 12px;
}

.blog-list-section {
    margin-bottom: 40px;
    padding-bottom: 16px;
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header h2 {
    margin: 0;
    font-size: 1.45rem;
}

.section-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.section-link:hover {
    text-decoration: underline;
}

/* Tool cards v2 */
.tool-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 280px;
}

.tool-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 16px 16px;
}

.tool-card h3 {
    margin: 10px 0 8px;
    font-size: 1.2rem;
}

.tool-card p {
    margin: 0;
    flex: 1;
}

.tool-category {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
}

.tool-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--secondary);
    color: #052e16;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
}

.tool-card-visual {
    position: relative;
}

.tool-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.feature-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 10px;
}

.feature-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.feature-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
}

/* FAQ */
.faq-section h2 {
    margin-top: 0;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    background: #fff;
    overflow: hidden;
}

.faq-question {
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 700;
    list-style: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-answer {
    padding: 0 16px 14px;
    color: var(--muted);
    line-height: 1.55;
}

.faq-answer p {
    margin: 0;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-top: 10px;
    margin-bottom: 4px;
    padding-top: 6px;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    font-size: 0.88rem;
}

.breadcrumbs li:not(:last-child)::after {
    content: "›";
    margin-left: 8px;
    color: #94a3b8;
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Blog preview */
.blog-preview-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-preview-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
}

.blog-preview-body {
    padding: 0 20px 20px;
}

.blog-preview-body > p:not(.blog-meta) {
    margin: 0 0 10px;
    line-height: 1.5;
    color: var(--muted);
}

.blog-preview-body .tool-link {
    margin: 8px 0 0;
    display: inline-flex;
}

.blog-preview-body .blog-meta {
    margin: 0 0 6px;
}

.blog-preview-body h3 {
    margin: 8px 0;
    font-size: 1.05rem;
}

.blog-preview-body h3 a {
    color: inherit;
    text-decoration: none;
}

.blog-preview-body h3 a:hover {
    color: var(--primary);
}

.blog-grid .tool-card,
.blog-preview-card {
    margin: 0;
}

.blog-links-list {
    margin: 0;
    padding-left: 1.2rem;
}

.blog-links-list a {
    color: var(--primary);
    font-weight: 600;
}

/* Footer */
.site-footer {
    background: #ffffff;
    margin-top: auto;
}

.site-footer .container {
    width: 100%;
    box-sizing: border-box;
}

.footer-grid {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(150px, 1fr));
    gap: 32px 48px;
    padding: 40px 0 24px;
    text-align: left;
    align-items: start;
}

@media (min-width: 993px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        column-gap: 56px;
    }
}

.footer-brand {
    min-width: 0;
}

.footer-logo {
    margin-left: 0;
    padding: 4px 12px 4px 4px;
    max-width: 100%;
}

.footer-desc {
    margin: 12px 0 0;
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 320px;
    color: var(--muted);
}

.footer-col h3 {
    margin: 0 0 12px;
    font-size: 0.95rem;
}

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

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #eff6ff;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 16px 0 24px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--muted);
}

.footer-bottom p {
    margin: 0;
}

/* Header mobile */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
    justify-self: end;
    grid-column: 3;
}

.nav-toggle-bar {
    width: 24px;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
}

.header-inner {
    grid-template-columns: 1fr auto auto;
}

/* Toast & loading */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--dark);
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 50;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.loading-overlay {
    flex-direction: column;
    gap: 14px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Textareas */
textarea.textarea-auto,
.panel-tool textarea {
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    min-height: 140px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.seo-article h2 {
    margin-top: 1.4em;
}

.tool-results {
    scroll-margin-top: 96px;
}

@media (max-width: 640px) {
    .diff-output-toolbar,
    .tool-output-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .diff-output-toolbar .diff-summary {
        justify-content: flex-start;
    }
}

@media (max-width: 992px) {
    .hero-premium-inner {
        grid-template-columns: 1fr;
        padding: 36px 24px;
    }

    .hero-visual {
        order: -1;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-col-legal {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 8px 0 12px;
    }

    .main-nav.is-open {
        display: flex;
    }

    .breadcrumbs {
        margin-top: 14px;
        padding-top: 8px;
        margin-bottom: 6px;
    }

    .site-footer .container {
        padding-inline: 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px 20px;
        padding: 28px 0 20px;
    }

    .footer-brand {
        grid-column: 1 / -1;
        padding: 0 0 8px;
        margin-bottom: 4px;
        border-bottom: 1px solid var(--border);
    }

    .footer-logo {
        margin-left: 0;
        padding: 6px 14px 6px 6px;
    }

    .footer-desc {
        max-width: none;
        margin-top: 14px;
        font-size: 0.9rem;
    }

    .footer-col {
        padding-top: 4px;
    }

    .footer-col h3 {
        font-size: 0.88rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--dark);
    }

    .footer-col-legal {
        grid-column: 1 / -1;
        padding-top: 16px;
        margin-top: 4px;
        border-top: 1px solid var(--border);
    }

    .footer-bottom {
        padding: 18px 0 28px;
        font-size: 0.85rem;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .footer-brand {
        border-bottom: none;
        padding-bottom: 20px;
    }

    .footer-col {
        padding: 18px 0;
        border-top: 1px solid var(--border);
    }

    .footer-col-legal {
        margin-top: 0;
    }
}
