/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --accent: #f59e0b;
    --success: #10b981;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Utility: Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== SKIP LINK ===== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    z-index: 1000;
    font-weight: 600;
    border-radius: 0 0 8px 0;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 30px 0 0;
    text-align: center;
}

/* Logo Link */
.logo-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.logo-link:hover {
    opacity: 0.9;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.logo-icon {
    display: inline-block;
    animation: spin 4s linear infinite;
}

.logo-text {
    color: #fff;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.tagline {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 4px;
    font-weight: 400;
    line-height: 1.4;
    padding: 0 10px 24px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    padding: 10px 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    margin: 0 auto;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    gap: 6px;
    font-size: 0.78rem;
    flex-wrap: wrap;
}

.breadcrumb li {
    color: rgba(255,255,255,0.8);
}

.breadcrumb li:not(:last-child)::after {
    content: "/";
    margin-left: 6px;
    color: rgba(255,255,255,0.5);
}

.breadcrumb a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb li[aria-current="page"] {
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}

/* ===== MAIN ===== */
.main {
    flex: 1;
    padding-top: 24px;
    padding-bottom: 40px;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex-shrink: 0;
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Inter', sans-serif;
}

.tab-btn:hover {
    background: #eef2ff;
    border-color: var(--primary-light);
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.tab-icon {
    font-size: 1rem;
}

/* ===== CONVERTER CARD ===== */
.converter-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

/* ===== INPUT GROUP ===== */
.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    font-size: 1.3rem;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: #f9fafb;
    transition: var(--transition);
    outline: none;
    font-family: 'Inter', sans-serif;
}

.input-field:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

/* ===== CONVERSION ROW ===== */
.conversion-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 24px;
}

.unit-box {
    flex: 1;
}

.unit-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.unit-select {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: #f9fafb;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    font-family: 'Inter', sans-serif;
}

.unit-select:focus {
    border-color: var(--primary);
    background-color: #fff;
}

/* ===== SWAP BUTTON ===== */
.swap-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--card-bg);
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 2px;
}

.swap-btn:hover {
    background: #eef2ff;
    border-color: var(--primary);
    transform: rotate(180deg);
}

/* ===== RESULT BOX ===== */
.result-box {
    background: linear-gradient(135deg, #f0f9ff, #eef2ff);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    border: 1.5px dashed var(--primary-light);
    position: relative;
}

.result-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    display: block;
    margin-bottom: 4px;
}

.result-display {
    margin: 8px 0;
}

.result-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -1px;
}

.result-unit {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-light);
    margin-left: 4px;
}

.copy-btn {
    margin-top: 8px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1.5px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.copy-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* ===== INFO BOX ===== */
.info-box {
    margin-top: 16px;
    padding: 14px 16px;
    background: #fffbeb;
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
    font-size: 0.82rem;
    color: #92400e;
    line-height: 1.5;
}

/* ========================================== */
/* ===== SEO SECTIONS (NEW & IMPROVED) ===== */
/* ========================================== */

.seo-section {
    margin-top: 36px;
    padding: 0;
    color: var(--text);
}

.seo-section h2 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.seo-section h3 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 6px;
    font-weight: 600;
}

.seo-section p {
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--text-light);
    margin-bottom: 12px;
}

.seo-section strong {
    color: var(--text);
    font-weight: 600;
}

.seo-section em {
    color: var(--primary);
    font-style: normal;
    font-weight: 500;
}

/* Ordered List dalam Section (How to Use) */
.seo-section ol {
    padding-left: 24px;
    margin-bottom: 14px;
}

.seo-section ol li {
    font-size: 0.92rem;
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1.6;
    padding-left: 4px;
}

.seo-section ol li::marker {
    color: var(--primary);
    font-weight: 700;
}

/* ===== UNIT GRID (Supported Units) ===== */
.unit-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 6px;
}

.unit-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 16px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.unit-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.unit-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.unit-card p {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0;
}

/* ===== FAQ LIST ===== */
.faq-list {
    margin-top: 6px;
}

.faq-list dt {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 16px;
    margin-bottom: 4px;
    cursor: default;
    padding-left: 0;
    position: relative;
}

.faq-list dt::before {
    content: "Q: ";
    color: var(--primary);
    font-weight: 700;
}

.faq-list dd {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.65;
    margin-left: 0;
    margin-bottom: 8px;
    padding-left: 20px;
    border-left: 2px solid var(--border);
}

/* ========================================== */
/* ===== FOOTER (NEW GRID LAYOUT) ===== */
/* ========================================== */

.footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 32px 0 20px;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-light);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
    margin-bottom: 12px;
}

.footer-col p {
    font-size: 0.82rem;
    line-height: 1.6;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.83rem;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Footer Link di Converter List */
.footer-link {
    cursor: pointer;
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-light);
}

.footer-bottom p {
    margin: 0;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    z-index: 999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    /* Footer grid menjadi stack */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-col {
        text-align: center;
    }

    .footer-col ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
    }

    .footer-col ul li {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .converter-card {
        padding: 20px 16px;
    }

    .result-value {
        font-size: 1.8rem;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 0.78rem;
    }

    .input-field {
        font-size: 1.1rem;
    }

    .header {
        padding: 24px 0 0;
    }

    .tagline {
        font-size: 0.8rem;
        padding: 0 8px 18px;
    }

    .seo-section h2 {
        font-size: 1.1rem;
    }

    .seo-section h3 {
        font-size: 0.9rem;
    }

    .faq-list dt {
        font-size: 0.88rem;
    }

    .faq-list dd {
        font-size: 0.83rem;
    }

    .footer-bottom {
        font-size: 0.72rem;
    }
}
