* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --secondary-color: #3b82f6;
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
    --success-color: #10b981;
    --error-color: #ef4444;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
}

.converter-card {
    background: var(--card-bg);
    border-radius: 25px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.converter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.converter-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.last-updated {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.converter-body {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.amount-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.amount-section label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.amount-input {
    width: 100%;
    padding: 20px;
    font-size: 2rem;
    font-weight: 700;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
    color: var(--text-primary);
}

.amount-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.currency-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: end;
}

.currency-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.currency-box label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.currency-select-wrapper {
    position: relative;
}

.currency-select {
    width: 100%;
    padding: 20px 50px 20px 60px;
    font-size: 1.1rem;
    font-weight: 500;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    outline: none;
    appearance: none;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.currency-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.currency-select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    z-index: 1;
}

.flag-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
    pointer-events: none;
    z-index: 2;
}

.swap-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-bottom: 32px;
}

.swap-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: rotate(180deg);
}

.swap-btn:active {
    transform: rotate(180deg) scale(0.95);
}

.result-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    border: 2px solid rgba(16, 185, 129, 0.2);
}

.result-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.result-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    word-break: break-all;
}

.result-info {
    font-size: 1rem;
    color: var(--text-secondary);
}

.convert-btn {
    width: 100%;
    padding: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.convert-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.convert-btn:active {
    transform: translateY(0);
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid rgba(239, 68, 68, 0.2);
    margin-top: 20px;
}

.popular-rates {
    background: var(--card-bg);
    border-radius: 25px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.popular-rates h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.rate-item {
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s ease, background 0.2s ease;
    border: 2px solid transparent;
}

.rate-item:hover {
    transform: translateY(-3px);
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

.rate-pair {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.rate-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.rate-change {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .converter-card,
    .popular-rates {
        padding: 25px;
    }

    .currency-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .swap-btn {
        margin: 0 auto;
        margin-bottom: 0;
    }

    .result-value {
        font-size: 2rem;
    }

    .amount-input {
        font-size: 1.5rem;
    }

    .rates-grid {
        grid-template-columns: 1fr;
    }
}


