:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #ef4444;
    --secondary-hover: #dc2626;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --focus-ring: rgba(79, 70, 229, 0.4);
    --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);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 1400px;
    text-align: center;
    margin: 0 auto;
}

header {
    margin-bottom: 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.converter-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
    transition: transform 0.2s ease;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.article-content {
    text-align: left;
    max-width: 1100px;
    margin: 48px auto;
    background: #fff;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.article-content h1,
.article-content h2,
.article-content h3 {
    color: var(--text-main);
    margin-top: 32px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.article-content h1 {
    font-size: 2.25rem;
}

.article-content h2 {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 20px;
    line-height: 1.7;
    color: #374151;
}

.article-content strong {
    color: #111827;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 1rem;
}

.article-content th,
.article-content td {
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    text-align: left;
}

.article-content th {
    background-color: #f9fafb;
    font-weight: 600;
}

.article-content tr:nth-child(even) {
    background-color: #f8fafc;
}

.article-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.article-content a:hover {
    text-decoration: underline;
}

.article-content ul {
    margin: 16px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}


.input-group {
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    transition: all 0.2s;
    background-color: #f9fafb;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--focus-ring);
    background-color: #fff;
}

/* Remove Arrows from Number Input */
.input-group input[type=number]::-webkit-inner-spin-button,
.input-group input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-group input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.arrow-divider {
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: 300;
    user-select: none;
}

.button-group {
    display: flex;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    font-family: inherit;
    font-size: 0.95rem;
}

.btn-secondary {
    background-color: var(--bg-color);
    color: var(--text-muted);
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: var(--text-main);
}

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

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

.return-link {
    margin-top: 16px;
    font-size: 0.95rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.container {
    animation: fadeIn 0.5s ease-out;
}

/* Flashcard Links Section */
.related-tools {
    margin: 60px auto;
    max-width: 1200px;
}

.related-tools h2 {
    font-size: 1.75rem;
    margin-bottom: 32px;
    color: var(--text-main);
    text-align: center;
}

.flashcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 0 20px;
}

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

.flashcard:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    background: linear-gradient(145deg, #ffffff, #f9fafb);
}

.flashcard span {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.flashcard p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .flashcard-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .flashcard-grid {
        grid-template-columns: 1fr;
    }
}