/* ====== RESET ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ====== BASE ====== */
:root{
  --bg: #f4f7fa;
  --card: #ffffff;
  --text: #333;
  --muted: #7f8c8d;
  --accent-green: #1abc9c;
  --accent-green-600: #16a085;
  --accent-blue: #3498db;
  --accent-blue-600: #2980b9;
  --danger: #e74c3c;
  --danger-600: #c0392b;
  --table-head: #34495e;
  --table-row: #ecf0f1;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding-top: 50px;
}

.container {
    background-color: var(--card);
    border-radius: 12px;
    padding: 5px 30px 30px 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 600px;
    text-align: center;
}

h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* ====== FORM / CONVERTER ====== */
.converter {
    margin-top: 10px;
}

.input-container, .currency-selectors {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 6px;
}

input[type="number"], select {
    width: 100%;
    padding: 10px;
    margin-top: 4px;
    border-radius: 8px;
    border: 1px solid #d0d6db;
    font-size: 1rem;
    background: #fff;
    transition: box-shadow 0.15s, border-color 0.15s;
}

input[type="number"]:focus, select:focus {
    outline: none;
    border-color: rgba(52,152,219,0.9);
    box-shadow: 0 6px 18px rgba(41,128,185,0.08);
}

/* select spacing */
.select-container {
    margin-bottom: 15px;
}

/* action buttons container */
.actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

/* green action buttons (convert / swap) */
.convertBtn, .swapBtn {
    background-color: var(--accent-green);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05rem;
    width: 48%;
    transition: background-color 0.22s, transform 0.18s, box-shadow 0.18s;
    box-shadow: 0 6px 14px rgba(26, 188, 156, 0.12);
}

.convertBtn:hover, .swapBtn:hover {
    background-color: var(--accent-green-600);
    transform: translateY(-2px) scale(1.01);
}

.convertBtn:focus, .swapBtn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(26,188,156,0.12);
}

/* result */
.result-container {
    margin-top: 20px;
    font-size: 1.25rem;
    font-weight: 700;
}

#converted-amount {
    color: #2c3e50;
    font-size: 1.6rem;
    margin-top: 6px;
}

/* ====== HISTORIAL (tabla) ====== */
.history {
    margin-top: 30px;
    width: 100%;
    max-width: 600px;
    background-color: #f9f9f9;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.history h2 {
    font-size: 1.25rem;
    color: var(--table-head);
    margin-bottom: 12px;
}

#history-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
}

#history-table th, #history-table td {
    padding: 10px 8px;
    border: 1px solid #e3e6e8;
    text-align: center;
    font-size: 0.95rem;
}

#history-table th {
    background-color: var(--table-head);
    color: white;
    font-size: 1rem;
}

#history-table td {
    color: var(--table-head);
}

#history-table tr:nth-child(even) {
    background-color: var(--table-row);
}

#history-table tr:hover {
    background-color: #d1d6da;
}

/* ====== BOTONES DE ACCIÓN ====== */
/* limpiar historial: aplicamos tanto clase como id para que funcione con cualquiera */
.clearHistoryBtn,
#clearHistoryBtn {
    display: inline-block;
    background-color: var(--danger);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05rem;
    width: 100%;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 6px 14px rgba(231,76,60,0.12);
    margin-top: 8px;
}

.clearHistoryBtn:hover,
#clearHistoryBtn:hover {
    background-color: var(--danger-600);
    transform: translateY(-2px);
}

.clearHistoryBtn:focus,
#clearHistoryBtn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(231,76,60,0.12);
}

/* ====== BOTONES DE NAVEGACIÓN ====== */
.nav-links {
    margin-top: 22px;
    text-align: center;
}

.nav-links button {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.22s, transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 6px 14px rgba(52,152,219,0.12);
}

.nav-links button:hover {
    background-color: var(--accent-blue-600);
    transform: translateY(-2px) scale(1.01);
}

.nav-links button:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(52,152,219,0.12);
}

/* ====== UTILS ====== */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* si en algún HTML usas la clase .btn o quieres estandarizar futuros botones */
.btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}
