/* ==========================================================================
   cyber-tool.org - Clean Corporate & Modern Web Utility Design System
   Inspired by Stripe, Cloudflare & Tailwind UI.
   Bright, polished, high-contrast, professional light theme.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Backgrounds */
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f1f5f9;
    --bg-input: #ffffff;
    --bg-muted: #f8fafc;

    /* Borders */
    --border-subtle: #f1f5f9;
    --border-default: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-focus: #3b82f6;

    /* Typography */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;

    /* Brand Accents */
    --brand-primary: #2563eb;
    --brand-primary-hover: #1d4ed8;
    --brand-light: #eff6ff;
    --brand-border: #bfdbfe;

    /* Functional Colors */
    --color-success: #059669;
    --color-success-bg: #ecfdf5;
    --color-success-border: #a7f3d0;

    --color-warning: #d97706;
    --color-warning-bg: #fffbeb;
    --color-warning-border: #fde68a;

    --color-danger: #dc2626;
    --color-danger-bg: #fef2f2;
    --color-danger-border: #fecaca;

    --color-purple: #7c3aed;
    --color-purple-bg: #f5f3ff;
    --color-purple-border: #ddd6fe;

    /* Radii & Shadows */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-base);
    background-image: linear-gradient(to bottom, #ffffff, var(--bg-base) 400px);
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Navigation */
.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    display: flex;
    align-items: center;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo-badge-icon {
    width: 32px;
    height: 32px;
    background: var(--brand-primary);
    color: #ffffff;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.logo-badge-icon svg {
    width: 18px;
    height: 18px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--brand-primary);
}

.lang-switch {
    display: flex;
    align-items: center;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 3px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.lang-btn {
    padding: 3px 10px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-tertiary);
    font-weight: 600;
    transition: all 0.15s ease;
}

.lang-btn.active {
    background: #ffffff;
    color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

/* Hero Section */
.hero {
    padding: 3.5rem 0 2.5rem;
    text-align: center;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--brand-light);
    border: 1px solid var(--brand-border);
    color: var(--brand-primary);
    font-size: 0.825rem;
    font-weight: 600;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-title span {
    color: var(--brand-primary);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

/* Search Bar (Stripe / Algolia style) */
.search-wrapper {
    max-width: 580px;
    margin: 0 auto 2.5rem;
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.15rem;
    gap: 0.85rem;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.search-box:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), var(--shadow-lg);
}

.search-box svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-sans);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Category Filter Tabs */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: #ffffff;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}

.filter-btn:hover {
    border-color: var(--brand-border);
    color: var(--brand-primary);
}

.filter-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.tool-card {
    background: #ffffff;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand-border);
    box-shadow: var(--shadow-hover);
}

.tool-card-top {
    margin-bottom: 1.25rem;
}

.tool-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.15rem;
}

.tool-icon-wrapper.icon-blue {
    background: var(--brand-light);
    color: var(--brand-primary);
}

.tool-icon-wrapper.icon-purple {
    background: var(--color-purple-bg);
    color: var(--color-purple);
}

.tool-icon-wrapper.icon-emerald {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.tool-icon-wrapper.icon-amber {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.tool-icon-wrapper svg {
    width: 22px;
    height: 22px;
}

.tool-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
    letter-spacing: -0.01em;
}

.tool-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.tool-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    font-weight: 500;
}

.pill-category {
    color: var(--text-tertiary);
}

.pill-privacy {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
    color: var(--color-success);
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.725rem;
    font-weight: 600;
}

.card-cta {
    color: var(--brand-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Tool Workspace Page */
.tool-page-header {
    padding: 2.5rem 0 1.5rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

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

.breadcrumbs a:hover {
    color: var(--brand-primary);
}

.workspace-card {
    background: #ffffff;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-mono);
    outline: none;
    transition: all 0.15s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: var(--brand-primary-hover);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-color: var(--border-default);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-surface-alt);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* Output Containers */
.output-card {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 1.5rem;
}

.output-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-default);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.output-title {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.output-body {
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-all;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: #ffffff;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1.25rem;
    background: var(--bg-surface-alt);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-default);
}

.data-table td {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.data-table tr:hover td {
    background: #fafafa;
}

/* Status Badges */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.status-pass {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}

.status-fail {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
}

.status-warn {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

/* Grade Boxes */
.grade-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-mono);
}

.grade-box.grade-A, .grade-box.grade-APlus {
    color: var(--color-success);
    background: var(--color-success-bg);
    border: 1.5px solid var(--color-success-border);
}

.grade-box.grade-B {
    color: var(--brand-primary);
    background: var(--brand-light);
    border: 1.5px solid var(--brand-border);
}

.grade-box.grade-C, .grade-box.grade-D {
    color: var(--color-warning);
    background: var(--color-warning-bg);
    border: 1.5px solid var(--color-warning-border);
}

.grade-box.grade-F {
    color: var(--color-danger);
    background: var(--color-danger-bg);
    border: 1.5px solid var(--color-danger-border);
}

/* SEO Docs Section */
.seo-article {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-default);
}

.seo-article h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.seo-article h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: var(--text-primary);
}

.seo-article p {
    color: var(--text-secondary);
    margin-bottom: 1.15rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.seo-article ul, .seo-article ol {
    margin: 0.75rem 0 1.5rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.seo-article li {
    margin-bottom: 0.4rem;
}

/* FAQ Accordion */
.faq-section {
    margin-top: 3rem;
}

.faq-item {
    background: #ffffff;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.faq-question {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.faq-question:hover {
    color: var(--brand-primary);
}

.faq-question svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.faq-item.open .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.25rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    display: none;
}

.faq-item.open .faq-answer {
    display: block;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text-primary);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Footer */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--border-default);
    padding: 4rem 0 2.5rem;
    background: #ffffff;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

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

.footer-col li {
    margin-bottom: 0.65rem;
}

.footer-col a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 2rem;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 2rem;
    }
    .header .nav-links {
        display: none;
    }
}
