:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 1rem;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 800px;
    /* Wider for reading */
    margin: 0 auto;
}

.converter-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    max-width: 480px;
    margin: 2rem auto 4rem auto;
    /* Centered with space below */
}

h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-group {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

button {
    cursor: pointer;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--border);
    color: var(--text-muted);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text-main);
}

.result {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f1f5f9;
    border-radius: 0.5rem;
    text-align: center;
    display: none;
}

.result.visible {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.result h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.ads-container {
    margin: 2rem auto;
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    background: #e2e8f0;
    border-radius: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Article Styles */
.info-section {
    background: #fff;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    margin-top: 3rem;
    margin-bottom: 3rem;
    /* Spacing */
}

.info-section h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.info-section h2:first-child {
    margin-top: 0;
}

.info-section h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.info-section p {
    margin-bottom: 1.5rem;
    color: #334155;
    font-size: 1.05rem;
    line-height: 1.75;
}

.info-section ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.info-section li {
    margin-bottom: 0.75rem;
    color: #334155;
    font-size: 1.05rem;
}

.info-section pre {
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    font-family: monospace;
    font-size: 1.1rem;
    border: 1px solid var(--border);
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-main);
}

tr:last-child td {
    border-bottom: none;
}

tr:nth-child(even) {
    background-color: #fcfcfd;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Related Tools Section */
.tools-section {
    margin-top: 4rem;
    margin-bottom: 4rem;
}

.tools-section h2 {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 2rem;
    font-weight: 600;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    width: 100%;
}

.tool-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.tool-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.tool-card span {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-main);
}

.tool-card .icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

@media (max-width: 640px) {
    .container {
        padding: 0;
    }

    .converter-card,
    .info-section {
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }
}