/* =========================================
   Global Variables & Reset
========================================= */
:root {
    --primary-color: #4361EE; 
    --secondary-color: #F72585; 
    --bg-color: #F4F7FE; 
    --card-bg: #FFFFFF;
    --text-main: #2B2D42;
    --text-muted: #8D99AE;
    --border-radius: 20px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

body.dark-mode {
    --bg-color: #0F172A; 
    --card-bg: #1E293B; 
    --text-main: #F8FAFC; 
    --text-muted: #94A3B8; 
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================================
   Navbar (Header)
========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s ease;
}

.logo {
    font-size: 20px;
    font-weight: 800;
}

.highlight {
    color: var(--primary-color);
}

.theme-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.theme-btn:hover {
    transform: scale(1.2) rotate(15deg);
}

/* =========================================
   Main Tool Layout
========================================= */
.tool-container {
    display: flex;
    justify-content: center;
    padding: 60px 5%;
}

.tool-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 600px;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: background-color 0.3s ease;
}

.card-header {
    margin-bottom: 10px;
}

.tool-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

/* =========================================
   Converter Wrapper & Inputs
========================================= */
.converter-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

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

.input-group label {
    display: block;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.input-row {
    display: flex;
    background-color: var(--bg-color);
    border: 2px solid transparent;
    border-radius: 15px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.input-row:focus-within {
    border-color: var(--primary-color);
}

.input-row input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    background: transparent;
    border: none;
    outline: none;
    width: 50%;
}

.input-row select {
    flex: 1;
    padding: 15px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    background-color: rgba(141, 153, 174, 0.1);
    border: none;
    border-left: 2px solid var(--card-bg);
    outline: none;
    cursor: pointer;
    width: 50%;
}

/* Readonly Styling for Output */
#output-value {
    color: var(--primary-color);
}

/* =========================================
   Swap Button
========================================= */
.swap-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    border: 4px solid var(--card-bg);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
    transition: transform 0.3s ease, background-color 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn:hover {
    background-color: #324edb;
    transform: translate(-50%, -50%) rotate(180deg);
}

/* =========================================
   Formula Box
========================================= */
.formula-box {
    background: rgba(141, 153, 174, 0.1);
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
}

#formula-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

/* =========================================
   SEO Content & FAQ
========================================= */
.content-section {
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 30px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s ease;
}

.content-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.content-section p, .content-section ol {
    margin-bottom: 15px;
    color: var(--text-muted);
}

.content-section ol {
    padding-left: 20px;
}

.faq-item {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(141, 153, 174, 0.2);
    padding-bottom: 15px;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

footer {
    text-align: center;
    padding: 30px 5%;
    margin-top: 20px;
    color: var(--text-muted);
}

/* =========================================
   Mobile Responsiveness
========================================= */
@media (max-width: 600px) {
    .tool-card {
        padding: 30px 15px;
    }
    
    .input-row {
        flex-direction: column;
        border-radius: 15px;
    }
    
    .input-row input, .input-row select {
        width: 100%;
        border-left: none;
    }
    
    .input-row select {
        border-top: 2px solid var(--card-bg);
    }

    .swap-btn {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 10px auto;
        border: none;
    }

    .swap-btn:hover {
        transform: rotate(180deg);
    }
}