@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

body {
    font-family: 'Lato', sans-serif;
    line-height: 1.6;
    background-color: #ffffff;
    color: #000000;
    margin: 0;
    padding: 0;
}

header {
    background: linear-gradient(135deg, #0d47a1, #1976d2);
    color: #ffffff;
    text-align: center;
    padding: 20px 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

header img,
header svg {
    max-width: 160px;
    height: auto;
    width: auto;
    display: block;
    margin: 0 auto 6px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

header p {
    font-size: 1.0rem;
    margin: 6px 0 0;
    opacity: 0.95;
}

.ad-banner {
    width: 100%;
    max-width: 100%;
    height: auto !important;
    padding: 10px;
    margin: 20px auto;
    text-align: center;
    display: block;
    box-sizing: border-box;
    background-color: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.ad-banner .banner-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 10px;
}

/* Desktop */
@media (min-width: 1024px) {
    #header-banner {
        max-width: 1200px;
    }
}

/* Mobile */
@media (max-width: 768px) {

    header {
        padding: 14px 10px;
    }

    #header-banner {
        margin: 12px auto;
        padding: 0 10px;
        margin-top: 8px; /* FIX: titik koma */
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        border-radius: 0;
    }

    .ad-banner .banner-img {
        width: 100%;
        height: auto;
        max-height: 240px;
        object-fit: contain;
        border-radius: 0;
    }
}

main.container {
    max-width: 1200px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

section {
    border: 1px solid #dee2e6;
    padding: 30px;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #007bff;
}

/* === Kurs Mata Uang Styles === */
.currency-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
}

.amount-group {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 2px solid #007bff;
    border-radius: 10px;
    padding: 12px 16px;
}

#from-symbol {
    font-size: 1rem;
    font-weight: bold;
    color: #007bff;
    margin-right: 15px;
}

#amount {
    font-size: 1rem;
    font-weight: bold;
    width: 100%;
    border: none;
    background: transparent;
    text-align: right;
    color: #000;
}

select#from-currency,
select#to-currency {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    border-radius: 14px;
    border: 1px solid #ddd;
    background-color: #ffffff;
    appearance: none;
}

.swap-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

button {
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s;
}

button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

button[onclick="swapCurrencies()"] {
    background-color: #e9ecef;
    color: #007bff;
    font-size: 2rem;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    align-self: center;
}

button[onclick="swapCurrencies()"]:hover {
    background-color: #dee2e6;
    transform: scale(1.1);
}

#convert-btn {
    width: 100%;
    padding: 18px;
    font-size: 1.4rem;
    font-weight: bold;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#convert-btn:hover {
    background-color: #0056b3;
}

#kurs-result {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    color: #007bff;
}

#kurs-rate,
#kurs-timestamp {
    text-align: center;
    font-size: 1.1rem;
    color: #555;
}

input, select, textarea {
    margin: 10px 0;
    padding: 12px;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
    border-color: #007bff;
    outline: none;
}

footer {
    background: linear-gradient(to right, #007bff, #00bfff);
    color: #ffffff;
    text-align: center;
    padding: 20px;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

/* === MOBILE === */
@media (max-width: 768px) {

    main.container {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    header h1 {
        font-size: 1.6rem;
        margin-bottom: 6px;
    }

    header p {
        font-size: 0.9rem;
        margin-top: 0;
    }

    .currency-inputs {
        padding: 25px;
        gap: 16px;
    }

    #currency-chart {
        width: 100% !important;
        height: 250px !important;
    }

    .amount-group {
        height: 58px;
        padding: 14px 18px;
    }

    #from-symbol,
    #amount {
        font-size: 1.9rem;
    }

    select#from-currency,
    select#to-currency {
        padding: 18px;
    }

    button[onclick="swapCurrencies()"] {
        width: 80px;
        height: 80px;
        font-size: 2.2rem;
    }

    header img,
    header svg {
        max-width: 130px;
        margin-bottom: 6px;
    }
}
