:root {
    /* Light mode colors */
    --bg-body: #f4f4f9;
    --bg-container: #ffffff;
    --text-primary: #000000;
    --text-secondary: #555555;
    --border-color: #cccccc;
    --border-dashed: #ddd;
    --bg-optional: #fafafa;
    --bg-button: #f0f0f0;
    --bg-button-hover: #eeeeee;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark mode colors */
        --bg-body: #1a1a1a;
        --bg-container: #2d2d2d;
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0b0;
        --border-color: #444444;
        --border-dashed: #555555;
        --bg-optional: #363636;
        --bg-button: #404040;
        --bg-button-hover: #4a4a4a;
        --shadow-color: rgba(0, 0, 0, 0.3);
    }
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg-container);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

h1 {
    text-align: center;
}

label {
    font-weight: bold;
    display: block;
    margin-top: 15px;
    color: var(--text-primary);
}

* {
    box-sizing: border-box;
}

input, select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-container);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: #666;
}

.exchange-container {
    display: flex;
    align-items: center;
}

.refresh-button {
    margin-left: 10px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
}

.output {
    margin-top: 20px;
    font-size: 1.1em;
    color: var(--text-primary);
}

.exchange-info {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Layout for source/target currency on the same row */
.currency-row {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}
.currency-row .field {
    flex: 1;
}
.currency-row label {
    display: block;
    margin-top: 0;
}

/* Styles for optional inputs summary */
.optional-details summary {
    font-weight: bold;
    cursor: pointer;
    padding: 8px 0;
    list-style: none;
    color: var(--text-primary);
}
.optional-details {
    margin-top: 12px;
    padding: 8px;
    border: 1px dashed var(--border-dashed);
    border-radius: 6px;
    background: var(--bg-optional);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.optional-details input {
    margin-top: 6px;
}

/* Price input with reset button */
.price-row {
    margin-top: 15px;
}
.input-with-button {
    display: flex;
    gap: 8px;
    align-items: center;
}
.input-with-button input {
    flex: 1;
}
.reset-button {
    background: var(--bg-button);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 1.1em;
    line-height: 1;
    transition: background-color 0.3s ease;
}
.reset-button:hover {
    background: var(--bg-button-hover);
}
