/* Modern Reset & Base Styles */
:root {
    --primary-gradient: linear-gradient(135deg, #FF416C 0%, #FF4B2B 100%);
    --secondary-gradient: linear-gradient(135deg, #FF4B2B 0%, #FF416C 100%);
    --background-gradient: linear-gradient(135deg, #1e1e24 0%, #2b2b36 100%);
    --surface-color: rgba(255, 255, 255, 0.95);
    --surface-blur: blur(20px);
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --border-radius: 16px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 50px rgba(255, 65, 108, 0.2);
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: var(--background-gradient);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Top Navigation */
.top-bar {
    padding: 1rem 2rem;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
}

/* Main Container */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Stack children vertically */
    align-items: center;
    padding: 5rem 1rem 3rem;
    /* Increased top padding */
    background: radial-gradient(circle at top right, rgba(255, 65, 108, 0.1), transparent 40%),
        radial-gradient(circle at bottom left, rgba(255, 75, 43, 0.1), transparent 40%);
    width: 100%;
}

.converter-card {
    background: var(--surface-color);
    backdrop-filter: var(--surface-blur);
    padding: 3.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md), var(--shadow-lg);
    width: 100%;
    max-width: 900px;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    margin-bottom: 4rem;
    /* Spacing between card and article */
}

/* ... Converter styles ... */
.converter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--primary-gradient);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.converter-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.converter-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.converter-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

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

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    display: flex;
    background: #f5f5f7;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 0.25rem;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #FF416C;
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 65, 108, 0.1);
}

.input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    font-family: var(--font-family);
    color: var(--text-primary);
    font-weight: 600;
    min-width: 0;
}

.input-wrapper input:focus {
    outline: none;
}

.input-wrapper select {
    border: none;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.5rem 2rem 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    transition: background 0.2s;
    outline: none;
    min-width: 180px;
    flex-shrink: 0;
}

.input-wrapper select:hover {
    background: rgba(0, 0, 0, 0.08);
}

.swap-container {
    display: flex;
    justify-content: center;
    margin: -0.5rem 0 1rem;
    position: relative;
    z-index: 2;
}

#swap-button {
    background: white;
    border: 2px solid #f0f0f0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #FF416C;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-sm);
}

#swap-button:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    transform: rotate(180deg) scale(1.1);
    box-shadow: var(--shadow-md);
}

.result-group .input-wrapper {
    background: rgba(255, 65, 108, 0.05);
}

.result-group input {
    color: #FF416C;
}

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

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#copy-button {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.3);
}

#copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 65, 108, 0.4);
}

#copy-button:active {
    transform: translateY(0);
}

#export-button {
    background: white;
    color: var(--text-secondary);
    border: 2px solid #f0f0f0;
}

#export-button:hover {
    border-color: #FF416C;
    color: #FF416C;
    background: white;
}

.toast {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 36, 0.9);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transition: all 0.3s ease;
}

.toast.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
}

/* SEO Article Styles */
.seo-article {
    width: 100%;
    max-width: 900px;
    background: var(--surface-color);
    backdrop-filter: var(--surface-blur);
    padding: 3rem;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.seo-article h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.seo-article h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: #333;
}

.seo-article h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.75rem;
    color: #444;
}

.seo-article p {
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
    color: #444;
}

.seo-article ul,
.seo-article ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    color: #444;
}

.seo-article li {
    margin-bottom: 0.5rem;
}

.seo-article code {
    background: rgba(255, 65, 108, 0.1);
    color: #D4145A;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: inherit;
    /* Keep standard font */
    font-weight: 600;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.seo-article table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.seo-article th,
.seo-article td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.seo-article th {
    background: #f8f8f8;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

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

.seo-article tr:hover td {
    background: #fdfdfd;
}

/* FAQ Styles */
.faq-item {
    background: #fff;
    border: 1px solid #eee;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: #FF416C;
}

.faq-item h3 {
    margin-bottom: 0.5rem;
    color: #222;
    font-size: 1.1rem;
    font-weight: 600;
}

.faq-item p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.cta-message {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(255, 65, 108, 0.05);
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 65, 108, 0.2);
}

.cta-message a {
    color: #FF416C;
    text-decoration: none;
    font-weight: 700;
}

.cta-message a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 600px) {
    .converter-card {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .converter-header h1 {
        font-size: 1.75rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .input-wrapper input {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        width: 100%;
    }

    .input-wrapper select {
        width: 100%;
        min-width: 0;
        margin: 0;
        border-radius: 0 0 12px 12px;
        background: transparent;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .actions {
        grid-template-columns: 1fr;
    }

    .seo-article {
        padding: 1.5rem;
    }

    .seo-article h1 {
        font-size: 1.75rem;
    }

    .seo-article h2 {
        font-size: 1.4rem;
    }
}