/* Modern currency converter styles */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(to right, #ff6a00, #ee0979);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    padding-bottom: 40px;
}

/* Widget card */
.currency-widget {
    background-color: #fff;
    width: 90%;
    max-width: 480px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rate-info {
    text-align: center;
    line-height: 1.4;
}

.rate-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.rate-value {
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

/* Conversion form */
.converter-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.field {
    flex: 1 1 45%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

.input-group {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    background-color: #fafafa;
}

.input-group input {
    flex: 1;
    padding: 14px 12px;
    font-size: 18px;
    border: none;
    outline: none;
    background: transparent;
}

.currency-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

/* Swap button */
.swap-btn {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-size: 20px;
    color: #4caf50;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.swap-btn:hover {
    background-color: #f5f5f5;
}

/* Dropdown styles */
.dropdown {
    position: absolute;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 260px;
    z-index: 1000;
}

.hidden {
    display: none;
}

.dropdown-search {
    width: 100%;
    border: none;
    border-bottom: 1px solid #eee;
    padding: 10px 14px;
    font-size: 16px;
    outline: none;
}

.currency-list {
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
}

.currency-list li {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.currency-list li:hover {
    background-color: #f7f7f7;
}

/* Flag icons use a fixed size to ensure consistency across browsers */
.flag-icon {
    width: 24px;
    height: 18px;
    margin-right: 6px;
    object-fit: cover;
    border-radius: 2px;
}

/* Flag span inside selector/dropdown */
.currency-flag {
    font-size: 20px;
    margin-right: 6px;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .converter-form {
        flex-direction: column;
        gap: 16px;
    }
    .field {
        flex: 1 1 100%;
        width: 100%;
    }
    .swap-btn {
        align-self: center;
    }
}