/* ====== 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;
  --navbar-bg: #2c3e50;
  --navbar-hover: #34495e;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-top: 70px;
    position: relative;
    overflow-x: hidden;
}

/* ====== NAVBAR ====== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--navbar-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-logo {
    height: 40px;
    width: 40px;
    object-fit: contain;
}

.navbar-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
}

.navbar-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.2s, transform 0.15s;
    font-size: 0.95rem;
}

.nav-link img {
    height: 20px;
    width: 20px;
    object-fit: contain;
}

.nav-link:hover {
    background-color: var(--navbar-hover);
    transform: translateY(-1px);
}

.nav-link.active {
    background-color: var(--accent-green);
    font-weight: 600;
}

.nav-link.active:hover {
    background-color: var(--accent-green-600);
}

/* ====== HERO SECTION ====== */
.hero-section {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 20px;
}

.hero-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Responsive navbar */
@media (max-width: 600px) {
    .navbar-content {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
        gap: 15px;
    }

    .navbar-title {
        font-size: 1.1rem;
    }

    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: 10px;
    }

    body {
        padding-top: 120px;
    }

    .hero-section {
        margin-top: 10px;
    }

    .hero-image {
        max-height: 120px;
    }
}

.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;
    margin-top: 20px;
    position: relative;
    z-index: 10;
}

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 - CENTRADOS */
.actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* 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;
    min-width: 140px;
    transition: background-color 0.22s, transform 0.18s, box-shadow 0.18s;
    box-shadow: 0 6px 14px rgba(26, 188, 156, 0.12);
}

/* Botón de swap con imagen */
.swapBtn {
    min-width: 50px;
    width: 50px;
    height: 50px;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: transparent;
    color: var(--accent-green);
    box-shadow: none;
    border: 2px solid var(--accent-green);
}

.swapBtn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: transform 0.3s;
}

.swapBtn:hover {
    background-color: rgba(26, 188, 156, 0.1);
    border-color: var(--accent-green-600);
    transform: translateY(-2px) scale(1.05);
}

.swapBtn:hover img {
    transform: rotate(180deg);
}

.swapBtn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(26,188,156,0.12);
    background-color: rgba(26, 188, 156, 0.05);
}

.convertBtn:hover {
    background-color: var(--accent-green-600);
    transform: translateY(-2px) scale(1.01);
}

.convertBtn: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;
    position: relative;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.result-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.result-container h2 {
    margin: 0;
}

#converted-amount {
    color: #2c3e50;
    font-size: 1.6rem;
    margin-top: 6px;
}

.success-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin: 10px auto;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ====== CHART SECTION ====== */
.chart-section {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.chart-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.chart-header h3 {
    margin: 0;
    color: var(--table-head);
    font-size: 1.1rem;
}

/* ====== 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;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state-image {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state p {
    color: var(--muted);
    font-size: 1.1rem;
}

#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);
}

/* ====== DECORATIVE ELEMENTS ====== */
.decorative-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.money-illustration {
    position: absolute;
    bottom: 50px;
    right: 20px;
    width: 200px;
    opacity: 0.1;
    object-fit: contain;
}

.world-map {
    position: absolute;
    top: 150px;
    left: -50px;
    width: 300px;
    opacity: 0.08;
    object-fit: contain;
}

.currency-coins {
    position: absolute;
    bottom: 100px;
    left: 30px;
    width: 180px;
    opacity: 0.12;
    object-fit: contain;
}

/* ====== FOOTER DECORATION ====== */
.footer-decoration {
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;
    height: 450px;
    overflow: hidden;
}

.footer-pattern {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center bottom;
    transform: scale(2);
    transform-origin: center bottom;
}

/* ====== 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;
}

/* Responsive decorations */
@media (max-width: 768px) {
    .money-illustration,
    .world-map,
    .currency-coins {
        display: none;
    }

    .footer-pattern {
        height: 60px;
    }
}

/* ====== FOOTER CON ENLACES ====== */
.footer {
    background: transparent;
    color: #ecf0f1;
    padding: 60px 20px 40px;
    margin-top: 50px;
    position: relative;
    z-index: 10;
    min-height: 320px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 35px;
    margin-bottom: 20px;
    position: relative;
    z-index: 10;
}

.footer-section h3 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.6);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.2s, padding-left 0.2s;
    display: inline-block;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--accent-green);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 2px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    font-size: 0.92rem;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

@media (max-width: 600px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer {
        padding: 50px 15px 40px;
        margin-top: 60px;
        min-height: 450px;
    }
    
    .footer-decoration {
        height: 520px;
    }
    
    .footer-pattern {
        transform: scale(1.5);
    }
}