:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --error: #ef4444;
    --glass-blur: blur(12px);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
}

h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
}

/* Header & Return Button */
.top-bar {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: flex-start;
}

.return-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.return-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-4px);
}

.return-btn .icon {
    width: 18px;
    height: 18px;
}

/* Main Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Converter Card */
.converter-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
}

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

    .swap-icon {
        transform: rotate(90deg);
        padding: 0.5rem;
    }
}

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

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    margin-left: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.swap-icon {
    color: var(--text-muted);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.swap-icon svg {
    width: 24px;
    height: 24px;
}

.error-msg {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 1.5rem;
    min-height: 1.4rem;
}

/* Ad Container */
.ad-container {
    margin: 2rem 0;
    min-height: 100px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

/* Article Content */
.article-content {
    margin-top: 4rem;
    text-align: left;
}

.info-section {
    margin-bottom: 4rem;
}

.info-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
}

.info-section h3 {
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
    color: var(--text-main);
}

.info-section p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Lists */
.symbol-list,
.benefit-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.symbol-list li,
.benefit-list li {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
}

.benefit-list {
    grid-template-columns: 1fr;
}

.benefit-list li {
    text-align: left;
    padding-left: 3rem;
    position: relative;
}

.benefit-list li::before {
    content: "✓";
    position: absolute;
    left: 1rem;
    color: var(--primary);
    font-weight: bold;
}

/* Rules Grid */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.rule-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.rule-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.rule-card h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* FAQ Grid */
.faq-grid {
    display: grid;
    gap: 1.5rem;
}

.faq-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.faq-item h4 {
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

/* Improved Table */
.roman-table {
    width: 100%;
    margin: 2rem 0;
}

.roman-table td {
    padding: 0.75rem 1rem;
}

.roman-table strong {
    color: var(--primary);
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .info-section h2 {
        font-size: 1.5rem;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}