/* Feet Converter Specific Styles */

/* --- Variables --- */
:root {
    --brand-primary: #2563eb;
    --brand-primary-hover: #1d4ed8;
    --bg-light: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --card-bg: #ffffff;
}

:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 3px;
}

/* --- Layout & Sections --- */
.converter-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.tool-cover--feet {
    background-image: url('https://images.unsplash.com/photo-1581093458791-9f3c3900bata?ixlib=rb-1.2.1&auto=format&fit=crop&w=1200&q=80');
}

.converter-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.converter-body {
    padding: 2.5rem;
}

.article-centered {
    max-width: 900px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.footer-centered {
    text-align: center;
}

.logo-img {
    height: 40px;
    width: auto;
}

/* --- Converter Grid --- */
.conversion-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.1rem;
    display: block;
}

/* --- Inputs --- */
.value-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    font-family: var(--font-heading, sans-serif);
    font-weight: 700;
    color: var(--text-main);
    transition: all 0.2s ease;
    background-color: #fff;
    /* Ensure white bg */
}

.value-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.value-input[readonly] {
    background-color: var(--bg-light);
    color: var(--text-muted);
    cursor: default;
    border-color: #f1f5f9;
}

/* --- Unit Selection List --- */
.unit-list-container {
    height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 1rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    background-color: #fff;
}

.unit-list-container::-webkit-scrollbar {
    width: 6px;
}

.unit-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.unit-list-container::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
}

.unit-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-muted);
    font-size: 1rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.unit-option:last-child {
    border-bottom: none;
}

.unit-option:hover {
    background-color: #f8fafc;
    color: var(--text-main);
}

.unit-option:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: -2px;
    /* Ensure focus is visible inside the list */
    z-index: 1;
    position: relative;
}

/* Active State */
.unit-option.active,
.unit-option[aria-checked="true"] {
    background-color: #eff6ff;
    color: var(--brand-primary);
    font-weight: 600;
    border-left: 3px solid var(--brand-primary);
    padding-left: calc(1rem - 3px);
    /* Adjust padding to keep text aligned or just let it shift slightly */
}

/* --- Swap Button --- */
.swap-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 1.5rem;
    /* Align somewhat with inputs */
}

.swap-btn {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.swap-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: rotate(180deg);
}

.swap-btn:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* --- Result Preview --- */
.result-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
    color: #166534;
    text-align: center;
}

.result-title {
    font-family: var(--font-heading, sans-serif);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.result-text {
    font-size: 1.25rem;
    font-weight: 500;
    word-break: break-word;
}

.result-highlight {
    background: var(--brand-primary);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.helper-text {
    text-align: center;
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.9rem;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .converter-body {
        padding: 1.5rem;
    }

    .conversion-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .swap-container {
        padding-top: 0;
        transform: rotate(90deg);
    }

    .swap-btn:hover {
        transform: rotate(270deg);
    }
}

/* --- SEO Article Styles (Replaces Inline Styles) --- */
.seo-article {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    color: #334155;
    line-height: 1.8;
    font-size: 1.05rem;
}

.seo-article h2 {
    color: var(--text-main);
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
}

.seo-article h3 {
    color: var(--brand-primary);
    font-size: 1.6rem;
    margin-top: 2rem;
}

/* Specific Info Boxes */
.seo-info-box {
    background: #f8fafc;
    padding: 1.5rem;
    border-left: 4px solid var(--brand-primary);
    margin: 1.5rem 0;
    border-radius: 0 12px 12px 0;
}

.seo-info-box h4 {
    margin-top: 0;
    color: #0f172a;
    font-size: 1.1rem;
}

.seo-info-box ul {
    margin-bottom: 0;
}

.seo-warning-box {
    background: #f0fdf4;
    padding: 1.5rem;
    border-left: 4px solid #16a34a;
    margin: 1.5rem 0;
    border-radius: 0 12px 12px 0;
}

.seo-warning-box h4 {
    margin-top: 0;
    color: #14532d;
    font-size: 1.1rem;
}

/* Tables */
.seo-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.seo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    white-space: nowrap;
}

.seo-table th,
.seo-table td {
    padding: 0.75rem;
    text-align: left;
}

.seo-table thead tr {
    background-color: #e2e8f0;
    border-bottom: 2px solid #cbd5e1;
}

.seo-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

/* Links */
.seo-link {
    color: var(--brand-primary);
    text-decoration: underline;
}

/* FAQ Accordions */
.seo-faq-wrapper {
    margin-top: 3rem;
    background-color: #f1f5f9;
    padding: 2rem;
    border-radius: 12px;
}

.seo-faq-wrapper h3 {
    color: #0f172a;
    margin-top: 0;
    font-size: 1.5rem;
}

.seo-faq-item {
    margin-top: 1.25rem;
}

.seo-faq-summary {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    list-style: none;
    /* Hide default arrow */
    position: relative;
    padding-left: 1.5rem;
    user-select: none;
}

.seo-faq-summary::-webkit-details-marker {
    display: none;
}

.seo-faq-summary::before {
    content: '+';
    position: absolute;
    left: 0;
    top: -2px;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--brand-primary);
    transition: transform 0.2s ease;
}

details[open].seo-faq-item .seo-faq-summary::before {
    content: '-';
    top: -4px;
}

.seo-faq-item p {
    margin-top: 0.75rem;
    padding-left: 1.5rem;
    margin-bottom: 0;
}

/* --- Reference Conversion Tables (New Article) --- */
.conversion-reference-table {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.conversion-reference-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.conversion-reference-table caption {
    font-weight: 600;
    color: var(--brand-primary);
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    text-align: left;
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
    border-radius: 12px 12px 0 0;
}

.conversion-reference-table th {
    background: #f1f5f9;
    padding: 0.7rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.conversion-reference-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.conversion-reference-table tr:last-child td {
    border-bottom: none;
}

.conversion-reference-table tbody tr:hover {
    background-color: #f8fafc;
}

/* --- Inline Tool CTA (pointing back to the calculator) --- */
.tool-cta-inline {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #93c5fd;
    border-left: 4px solid var(--brand-primary);
    padding: 0.85rem 1.25rem;
    border-radius: 0 10px 10px 0;
    margin: 1.5rem 0;
    font-size: 1rem;
    color: #1e3a8a;
}

.tool-cta-inline a {
    color: var(--brand-primary);
    font-weight: 600;
}

/* --- Intro paragraph --- */
.seo-intro {
    font-size: 1.15rem;
    line-height: 1.85;
    color: #334155;
    margin-bottom: 1.25rem;
}

/* --- Inline code snippets --- */
.seo-article code {
    background: #f1f5f9;
    color: #0369a1;
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    font-weight: 600;
}

/* --- FAQ section heading inside article --- */
.faq-heading {
    font-size: 1.8rem;
    margin-top: 3rem;
    margin-bottom: 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}