/* --- Main Card --- */
#converter-card {
    background: linear-gradient(145deg, #ffffff, #f9fafb);
    animation: slideInUp 0.8s ease-out;
    box-shadow: 0 12px 28px 0 rgba(0, 0, 0, 0.08), 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Amount Input --- */
.amount-input {
    padding: 0.75rem 1rem;
    -moz-appearance: textfield;
    /* Firefox */
}

.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* --- Custom Select Dropdown --- */
.select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    /* Smaller left padding for mobile */
    background-color: #ffffff;
    border: 1px solid #D1D5DB;
    /* gray-300 */
    border-radius: 0.5rem;
    /* rounded-lg */
    font-size: 0.875rem;
    /* 14px, better for mobile */
    line-height: 1.25rem;
    font-weight: 500;
    color: #1F2937;
    /* gray-800 */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    /* Prevent ugly cutoff */
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

@media (min-width: 640px) {

    /* sm breakpoint */
    .custom-select {
        font-size: 1rem;
        /* Back to 16px on larger screens */
        line-height: 1.5rem;
        padding-left: 1rem;
    }
}

.custom-select:focus {
    outline: none;
    border-color: #6366F1;
    /* indigo-500 */
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.custom-select:hover {
    border-color: #9CA3AF;
    /* gray-400 */
}

.select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.75rem;
    width: 1.25rem;
    /* w-5 */
    height: 1.25rem;
    /* h-5 */
    transform: translateY(-50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-chevrons-up-down'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

/* --- Swap Button --- */
.swap-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    /* 44px */
    height: 2.75rem;
    /* 44px */
    border-radius: 9999px;
    /* rounded-full */
    border: 1px solid #e5e7eb;
    /* gray-200 */
    background-color: #ffffff;
    color: #4B5563;
    /* gray-600 */
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.swap-button:hover {
    background-color: #eef2ff;
    /* indigo-50 */
    color: #4338ca;
    /* indigo-700 */
    border-color: #c7d2fe;
    /* indigo-200 */
}

.swap-button:active>i,
.swap-button:focus-visible>i {
    transform: rotate(180deg);
}

.swap-button:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}


/* --- Result Display --- */
.result-display {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    /* gray-100 */
    border-radius: 0.75rem;
    /* rounded-xl */
    padding: 1rem;
    text-align: center;
    transition: background-color 0.5s ease;
    word-break: break-all;
}

.result-display.loading {
    justify-content: center;
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    /* gray-200 */
    border-top: 3px solid #4f46e5;
    /* indigo-600 */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.result-value {
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

#last-updated {
    opacity: 0;
    animation: fadeInAnimation 1s ease 1s forwards;
}

/* For result text styling, JS will add these */
.result-display .from-text {
    font-size: 1rem;
    color: #6b7280;
    /* gray-500 */
    margin-bottom: 0.25rem;
}

.result-display .to-text {
    font-size: 1.875rem;
    /* text-3xl */
    line-height: 2.25rem;
    font-weight: 700;
    /* font-bold */
    color: #3730a3;
    /* indigo-800 */
}

/* Responsive font size for larger screens */
@media (min-width: 640px) {

    /* sm breakpoint */
    .result-display .to-text {
        font-size: 2.25rem;
        /* text-4xl */
        line-height: 2.5rem;
    }
}