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

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0.75rem 0.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 480px) {
    .container {
        padding: 1rem 0.75rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 480px;
        padding: 2rem 1rem;
    }
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 480px) {
    .main {
        gap: 1.25rem;
    }
}

@media (min-width: 768px) {
    .main {
        gap: 1.5rem;
    }
}

.converter-card, .info-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

@media (min-width: 480px) {
    .converter-card, .info-card {
        padding: 1.25rem;
    }
}

@media (min-width: 768px) {
    .converter-card, .info-card {
        padding: 1.5rem;
    }
}

.input-section {
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .input-section {
        margin-bottom: 1.5rem;
    }
}

.input-group {
    margin-bottom: 1rem;
}

@media (min-width: 480px) {
    .input-group {
        margin-bottom: 1.25rem;
    }
}

@media (min-width: 768px) {
    .input-group {
        margin-bottom: 1.5rem;
    }
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.25rem;
    font-weight: 500;
    transition: all 0.2s;
    background: var(--surface);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.currency-selectors {
    display: flex;
    align-items: end;
    gap: 0.5rem;
}

@media (min-width: 480px) {
    .currency-selectors {
        gap: 0.75rem;
    }
}

@media (min-width: 768px) {
    .currency-selectors {
        gap: 1rem;
    }
}

.currency-group {
    flex: 1;
}

.currency-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.custom-select select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.custom-select select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.swap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.swap-btn:hover {
    background: var(--primary-hover);
    transform: rotate(180deg);
}

.result-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    color: white;
    text-align: center;
}

@media (min-width: 480px) {
    .result-section {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }
}

@media (min-width: 768px) {
    .result-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

.result-amount {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.exchange-rate {
    font-size: 0.9rem;
    opacity: 0.9;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

@media (min-width: 480px) {
    .action-buttons {
        gap: 0.75rem;
    }
}

@media (min-width: 768px) {
    .action-buttons {
        gap: 1rem;
    }
}

.btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.info-header h3 {
    font-weight: 600;
    color: var(--text-primary);
}

.update-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.info-content p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer {
    text-align: center;
    padding: 1rem 0;
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 479px) {
    .container {
        padding: 0.5rem 0.25rem;
    }
    
    .header {
        margin-bottom: 1rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .converter-card, .info-card {
        padding: 0.75rem;
    }
    
    .currency-selectors {
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
    }
    
    .currency-group {
        flex: 1;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
    }
    
    .currency-group label {
        margin-bottom: 0;
        /* font-size: 0.75rem; */
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .currency-group .custom-select {
        flex: 1;
    }
    
    .swap-btn {
        margin: 0;
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }
    
    .swap-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.375rem;
    }
    
    .result-amount {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
    
    .exchange-rate {
        font-size: 0.75rem;
    }
    
    .input-group input {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .custom-select select {
        padding: 0.75rem;
        padding-right: 2rem;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .result-section {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .info-header {
        margin-bottom: 0.5rem;
    }
    
    .info-content p {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .footer {
        font-size: 0.75rem;
        padding: 0.5rem 0;
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    .header {
        margin-bottom: 1.25rem;
    }
    
    .header h1 {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .currency-selectors {
        flex-direction: row;
        align-items: center;
        gap: 0.375rem;
    }
    
    .currency-group {
        flex: 1;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.375rem;
    }
    
    .currency-group label {
        margin-bottom: 0;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .currency-group .custom-select {
        flex: 1;
    }
    
    .swap-btn {
        margin: 0;
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .result-amount {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .exchange-rate {
        font-size: 0.8rem;
    }
    
    .input-group input {
        padding: 0.875rem;
        font-size: 1.125rem;
    }
    
    .custom-select select {
        padding: 0.875rem;
        padding-right: 2.25rem;
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
    
    .result-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .info-header {
        margin-bottom: 0.75rem;
    }
    
    .info-content p {
        font-size: 0.8rem;
        margin-bottom: 0.375rem;
    }
    
    .footer {
        font-size: 0.8rem;
        padding: 0.75rem 0;
    }
}



.error-message {
    background: var(--error-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
}

.success-message {
    background: var(--success-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
}