:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 480px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.converter-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label, .select-box label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.selection-container {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.select-box {
    flex: 1;
}

.select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    background: #fff;
}

.select-wrapper img {
    width: 25px;
    height: auto;
    border-radius: 2px;
}

select {
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
}

.swap-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    margin-bottom: 0.2rem;
}

.swap-btn:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: rotate(180deg);
}

.result-section {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    text-align: center;
}

.conversion-result h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 0.25rem;
}

.rate-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

#get-rate-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#get-rate-btn:hover {
    background: var(--primary-hover);
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(37, 99, 235, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
}

footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

@media (max-width: 400px) {
    .selection-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .swap-btn {
        align-self: center;
        transform: rotate(90deg);
    }
    
    .swap-btn:hover {
        transform: rotate(270deg);
    }
}
