/* TabGroup Vault Tools - Shared Components */
/* Loaded after ../blog/styles.css; uses the blog design tokens. */

:root {
    /* Match the extension's compact surface geometry and interaction timing. */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 150ms ease-out;
}

.blog-nav a:focus-visible,
.btn:focus-visible,
.tool-card-link:focus-visible,
.tool-drop-zone:focus-visible,
.tool-input:focus-visible,
.tool-select:focus-visible,
.tool-textarea:focus-visible,
.tool-segmented button:focus-visible,
.faq-item summary:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.25);
    outline-offset: 3px;
}

.tools-index-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6) var(--space-12);
}

.tools-hero {
    max-width: 760px;
    margin: 0 auto var(--space-8);
    text-align: center;
}

.tools-hero h1,
.article-header .tool-h1 {
    margin-bottom: var(--space-3);
}

.tools-hero p,
.article-header .tool-subtitle {
    margin: 0 auto;
    color: var(--color-text-secondary);
    font-size: 18px;
    line-height: 1.7;
    max-width: 680px;
}

.tool-privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: 8px 14px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.08);
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 600;
}

.tool-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-8);
    margin: var(--space-8) 0;
}

.tool-card h2,
.tool-card h3 {
    margin-top: 0;
}

.tool-card h2 {
    font-size: 22px;
    margin-bottom: var(--space-4);
}

.tool-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.tool-field label,
.tool-option label {
    color: var(--color-text-primary);
    font-size: 14px;
    font-weight: 700;
}

.tool-field-hint {
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.tool-input,
.tool-select,
.tool-textarea {
    width: 100%;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text-primary);
    font: inherit;
    padding: 12px 14px;
    transition: var(--transition);
}

.tool-input:not([type="range"]),
.tool-select {
    min-height: 44px;
}

.tool-input:focus,
.tool-select:focus,
.tool-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.tool-input[type="range"] {
    border: 0;
    padding: 0;
    background: transparent;
    accent-color: var(--color-primary);
}

.tool-input[type="range"]:focus {
    box-shadow: none;
}

.tool-textarea {
    min-height: 180px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 14px;
    line-height: 1.6;
}

.tool-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 120px;
    padding: var(--space-5);
    border: 2px dashed var(--color-border-strong);
    border-radius: var(--radius);
    background: var(--color-surface-alt);
    color: var(--color-text-secondary);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.tool-drop-zone:focus-visible {
    border-color: var(--color-primary);
    background: var(--color-highlight);
}

.tool-drop-zone:hover,
.tool-drop-zone:focus,
.tool-drop-zone.is-dragover {
    border-color: var(--color-primary);
    background: var(--color-highlight);
    color: var(--color-text-primary);
    text-decoration: none;
}

.tool-drop-zone i {
    color: var(--color-primary);
    font-size: 24px;
}

.tool-drop-zone strong {
    color: var(--color-text-primary);
}

.tool-drop-zone small {
    color: var(--color-text-muted);
}

.tool-btn-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.tool-btn-row .btn[disabled],
.tool-btn-row button[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.tool-secondary-btn {
    background: var(--color-surface);
    border-color: var(--color-border-strong);
    color: var(--color-text-primary) !important;
}

.tool-secondary-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.tool-results {
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border);
}

.tool-results[hidden],
.tool-error[hidden],
.tool-empty[hidden] {
    display: none !important;
}

.tool-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.tool-stat {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface-alt);
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.tool-stat strong {
    color: var(--color-text-primary);
}

.tool-error {
    margin-top: var(--space-4);
    padding: 12px 14px;
    border: 1px solid rgba(239, 68, 68, 0.24);
    border-radius: var(--radius);
    background: rgba(239, 68, 68, 0.08);
    color: var(--color-danger);
    font-size: 14px;
    font-weight: 600;
}

.tool-error::before {
    content: "\26A0";
    margin-right: 8px;
}

.tool-empty {
    margin-top: var(--space-4);
    padding: 12px 14px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: var(--radius);
    background: rgba(245, 158, 11, 0.08);
    color: var(--color-text-secondary);
    font-size: 14px;
}

.tool-preview-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-surface);
}

.tool-preview-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
}

.tool-preview-list li:last-child {
    border-bottom: none;
}

.tool-preview-title {
    color: var(--color-text-primary);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.tool-preview-meta {
    color: var(--color-text-muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.tool-table {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.tool-table table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.tool-table th,
.tool-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.tool-table th {
    background: var(--color-surface-alt);
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 700;
}

.tool-table td {
    color: var(--color-text-secondary);
    font-size: 14px;
}

.tool-cta {
    background: var(--gradient-card);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    margin: var(--space-10) 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.tool-cta h2,
.tool-cta h3 {
    margin: 0;
    color: var(--color-text-primary);
    font-size: 24px;
    line-height: 1.25;
}

.tool-cta p {
    max-width: 620px;
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

.tool-category-section {
    margin-top: var(--space-10);
}

.tool-category-section:first-of-type {
    margin-top: 0;
}

.tool-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.tool-category-header h2 {
    margin: 0;
    font-size: 24px;
}

.tool-category-count {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 700;
}

.tools-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-5);
}

.tool-index-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-height: 210px;
    padding: var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.tool-index-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(59, 130, 246, 0.28);
}

.tool-index-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: var(--color-highlight);
    color: var(--color-primary);
    font-size: 18px;
}

.tool-index-card h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
}

.tool-index-card h3 a {
    color: var(--color-text-primary);
}

.tool-index-card h3 a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.tool-index-card p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
}

.tool-card-link {
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 700;
}

.tool-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-3);
}

.tool-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-alt);
}

.tool-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-alt);
}

.tool-segmented button {
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 12px;
}

.tool-segmented button[aria-pressed="true"] {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.tool-segmented button:hover {
    color: var(--color-primary);
}

.tool-slider {
    display: grid;
    gap: var(--space-2);
}

.tool-slider input[type="range"] {
    width: 100%;
    accent-color: var(--color-primary);
}

.tool-quiz-progress {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tool-quiz-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--color-border-strong);
}

.tool-quiz-dot.is-active {
    background: var(--color-primary);
}

.tool-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 7px;
    border: 1px solid var(--color-border-strong);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
    background: var(--color-surface-alt);
    color: var(--color-text-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 720px) {
    .blog-nav-links {
        display: flex;
    }

    .blog-nav-links a:not(.btn) {
        display: none;
    }

    .tools-index-wrapper {
        padding: var(--space-6) var(--space-4) var(--space-10);
    }

    .tool-card,
    .tool-cta {
        padding: var(--space-5);
    }

    .tool-category-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .tools-card-grid {
        grid-template-columns: 1fr;
    }

    .tool-btn-row {
        align-items: stretch;
        flex-direction: column;
    }

    .tool-btn-row .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .blog-nav,
    .article-breadcrumb,
    .tool-card,
    .tool-cta,
    .related-articles,
    .article-faq,
    .blog-footer {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .article-wrapper,
    .tools-index-wrapper {
        max-width: none;
        padding: 0;
    }
}
