:root {
    --bg: linear-gradient(135deg, #232526 0%, #414345 100%);
    --text: #f6f8fa;
    --navbar: rgba(30, 32, 34, 0.98);
    --card: rgba(36, 38, 41, 0.98);
    --accent: #ff7849;
    --accent-hover: #ff4c29;
    --input: #282a2d;
    --input-text: #f6f8fa;
    --shadow: 0 6px 32px rgba(0, 0, 0, 0.18);
}

/* Base Styles */
body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    background-image: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* Theme Variants */
body.light {
    --bg: #f8f9fb;
    --text: #23272e;
    --navbar: #fff;
    --card: #fff;
    --accent: #007bff;
    --accent-hover: #0056b3;
    --input: #f0f2f5;
    --input-text: #23272e;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

body.dark {
    --bg: #18191a;
    --text: #f5f6fa;
    --navbar: #242526;
    --card: #242526;
    --accent: #ff7849;
    --accent-hover: #ff4c29;
    --input: #282a2d;
    --input-text: #f6f8fa;
    --shadow: 0 6px 32px rgba(0, 0, 0, 0.18);
}

/* Layout Structure */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

/* Header & Navigation */
.header {
    background: transparent;
    box-shadow: none;
    padding-bottom: 0.5rem;
}

.navbar {
    background: var(--navbar);
    border-radius: 16px;
    margin: 1.5rem auto 0;
    max-width: 700px;
    width: calc(100% - 3rem);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 2.2rem;
    position: sticky;
    top: 1rem;
    z-index: 10;
}

.navbar-title {
    font-weight: bold;
    font-size: 1.3rem;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
}

/* Theme Toggle */
#theme-toggle {
    border: none;
    font-size: 2.1rem;
    cursor: pointer;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    outline: none;
    margin-left: 1.2rem;
    padding: 0;
    transition: all 0.2s ease;
}

body.light #theme-toggle {
    background: #fff;
    color: #ffb300;
}

body.dark #theme-toggle {
    background: var(--accent);
    color: #fffbe6;
}

#theme-toggle:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    filter: brightness(1.08);
}

/* Hero Section */
.hero {
    text-align: center;
    margin: 2rem 0 1rem;
    padding: 0 1rem;
}

.hero h1 {
    font-size: 2.35rem;
    margin: 0 0 0.3rem;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text);
    opacity: 0.87;
    font-weight: 400;
    margin: 0.5rem 0;
}

/* Card Components */
.card {
    background: var(--card);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    margin: 1.5rem auto;
}

.converter-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2.2rem 1.5rem 1.5rem;
    border-radius: 22px;
}

.converter-card form {
    display: flex;
    gap: 0.8rem;
    width: 100%;
}

/* Form Elements */
.input-group {
    display: flex;
    width: 100%;
    gap: 0.8rem;
}

input[type="text"],
select,
button {
    height: 3.1rem;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

input[type="text"] {
    flex: 1;
    padding: 0 1.1rem;
    border: none;
    background: var(--input);
    color: var(--input-text);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.03);
    outline: none;
}

input[type="text"]::placeholder {
    color: #999;
    opacity: 1;
}

select {
    flex: 0 0 150px;
    padding: 0 1.1rem;
    border: 1.5px solid var(--accent);
    background: var(--input);
    color: var(--input-text);
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23fff" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M5.516 7.548a1 1 0 0 1 1.415 0L10 10.617l3.07-3.07a1 1 0 1 1 1.415 1.415l-3.777 3.778a1 1 0 0 1-1.415 0L5.516 8.963a1 1 0 0 1 0-1.415z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    cursor: pointer;
}

button {
    flex: 0 0 150px;
    padding: 0 1.5rem;
    border: none;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    letter-spacing: 0.5px;
}

button:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.11);
}

/* Donate Box */
.donate-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3fcf5;
    border: 2px solid #b7e2c1;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    margin: 0 auto 1.5rem;
    font-size: 1rem;
    color: #215c2f;
    gap: 0.7rem;
    max-width: 600px;
    width: calc(100% - 2rem);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.donate-icon {
    font-size: 1.5rem;
    color: #49b265;
}

.donate-link {
    color: #215c2f;
    font-weight: 700;
    text-decoration: underline;
    transition: color 0.2s;
}

.donate-link:hover {
    color: #49b265;
}

/* Instructions Box */
.instructions {
    margin: 2.5rem auto;
    padding: 2rem;
    background: var(--card);
    border-radius: 14px;
    box-shadow: var(--shadow);
    max-width: 700px;
    width: calc(100% - 4rem);
}

.instructions h2 {
    margin-top: 0;
    font-size: 1.3rem;
    color: var(--accent);
}

.instructions ol {
    padding-left: 1.2rem;
}

.instructions li {
    margin-bottom: 0.7rem;
    line-height: 1.7;
}

/* Download Section */
#download-section {
    margin-top: 1rem;
    text-align: center;
    word-break: break-word;
    border-radius: 14px;
    max-width: 600px;
    width: 100%;
}

.download-btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 1.13rem;
    font-weight: 600;
    padding: 0.9rem 2.1rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    margin: 1.2rem 0 0.5rem;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.download-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.11);
}

/* Footer */
.footer {
    padding: 1.2rem 0;
    text-align: center;
    color: var(--text);
    opacity: 0.7;
    font-size: 0.98rem;
    background: var(--navbar);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 2rem;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    margin: 0 0.7em;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 700px) {
    .navbar {
        padding: 1rem;
        margin-top: 1rem;
        width: calc(100% - 2rem);
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .card,
    .donate-box,
    .instructions,
    #download-section {
        padding: 1.5rem 1rem;
        width: calc(100% - 2rem);
    }

    .converter-card {
        padding: 1.5rem 1rem;
    }

    .converter-card form {
        flex-direction: column;
    }

    input[type="text"],
    select,
    button {
        width: 100%;
        flex: 1 1 auto;
    }

    .donate-box {
        white-space: normal;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .navbar-title {
        font-size: 1.1rem;
    }

    #theme-toggle {
        width: 2.8rem;
        height: 2.8rem;
        font-size: 1.8rem;
    }

    .download-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}