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

body {
    font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(145deg, #f5f7fc 0%, #eef2f8 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
}

/* Animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 620px;
}

/* Main Card */
.converter-card {
    background: #ffffff;
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.converter-card:hover {
    box-shadow: 0 30px 55px -15px rgba(0, 0, 0, 0.2);
}

/* Header with Currency Icons Background */
.card-header {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 1.5rem 1.8rem;
    overflow: hidden;
}

.header-bg-icons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.15;
    pointer-events: none;
}

.header-bg-icons i {
    position: absolute;
    font-size: 3rem;
    color: white;
}

.header-bg-icons i:nth-child(1) { top: 10%; left: 5%; transform: rotate(-15deg); font-size: 2.5rem; }
.header-bg-icons i:nth-child(2) { bottom: 15%; right: 8%; transform: rotate(10deg); font-size: 3rem; }
.header-bg-icons i:nth-child(3) { top: 40%; left: 80%; transform: rotate(25deg); font-size: 2rem; }
.header-bg-icons i:nth-child(4) { top: 70%; left: 15%; transform: rotate(-5deg); font-size: 2.2rem; }
.header-bg-icons i:nth-child(5) { top: 20%; right: 20%; transform: rotate(45deg); font-size: 2rem; }
.header-bg-icons i:nth-child(6) { bottom: 30%; left: 40%; transform: rotate(-20deg); font-size: 2.8rem; }

.header-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.currency-icon-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.currency-icon-main i {
    font-size: 1.8rem;
    color: white;
}

.card-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: white;
    margin-bottom: 0.3rem;
}

.card-header p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Form Styling */
form {
    padding: 1.8rem 1.8rem 1.5rem;
}

/* Input Group */
.input-group {
    margin-bottom: 1.8rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.6rem;
    letter-spacing: 0.3px;
}

.form-label i {
    color: #667eea;
    font-size: 0.8rem;
}

.amount-input-wrapper {
    position: relative;
}

.amount-input-wrapper input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.2rem;
    font-size: 1.3rem;
    font-weight: 600;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    background: #ffffff;
    color: #1a202c;
    transition: all 0.2s ease;
    font-family: inherit;
}

.amount-input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.amount-input-wrapper .input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1.1rem;
}

/* Currency Row */
.currency-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.currency-card {
    flex: 1;
    background: #f8fafc;
    border-radius: 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid #eef2ff;
    transition: all 0.2s;
}

.currency-card:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.currency-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.currency-label i {
    font-size: 0.7rem;
}

.currency-selector {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
}

.flag-container {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.flag-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.currency-selector select {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
    cursor: pointer;
    font-family: inherit;
    padding: 0.25rem 0;
    appearance: none;
}

.currency-selector select:focus {
    outline: none;
}

.selector-icon {
    color: #94a3b8;
    font-size: 0.7rem;
    pointer-events: none;
}

/* Swap Button */
.swap-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.swap-circle {
    width: 44px;
    height: 44px;
    background: #f1f5f9;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    color: #667eea;
    font-size: 1.1rem;
}

.swap-circle:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: scale(1.05);
}

.swap-circle:active {
    transform: scale(0.95);
}

/* Rate Display */
.rate-display {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 1rem;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #eef2ff;
}

.rate-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.rate-badge i {
    color: #667eea;
    font-size: 0.8rem;
}

.rate-badge span {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #667eea;
    letter-spacing: 0.5px;
}

.rate-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a202c;
    word-break: break-word;
    line-height: 1.4;
}

.rate-value .skeleton-loader {
    height: 32px;
    width: 80%;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Convert Button */
#convertBtn {
    width: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    border: none;
    padding: 1rem 1.2rem;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

#convertBtn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

#convertBtn:hover::before {
    width: 300px;
    height: 300px;
}

#convertBtn:hover {
    background: linear-gradient(135deg, #2d3a4f 0%, #1e293b 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

#convertBtn:active {
    transform: translateY(0);
}

#convertBtn .btn-arrow {
    transition: transform 0.2s ease;
}

#convertBtn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Footer */
.footer-note {
    padding: 1rem 1.8rem 1.3rem;
    border-top: 1px solid #eef2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 0.65rem;
    color: #94a3b8;
    background: #fafcff;
}

.footer-note i {
    color: #667eea;
    font-size: 0.7rem;
}

/* Loading State */
.loading-rate {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.loading-rate i {
    color: #667eea;
    font-size: 1rem;
}

/* Error State */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 500;
}

.error-message i {
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 550px) {
    .container {
        max-width: 100%;
    }
    
    .converter-card {
        border-radius: 1.5rem;
    }
    
    .card-header h1 {
        font-size: 1.2rem;
    }
    
    form {
        padding: 1.3rem;
    }
    
    .currency-row {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .swap-container {
        margin: -0.3rem 0;
    }
    
    .swap-circle {
        transform: rotate(90deg);
        width: 38px;
        height: 38px;
    }
    
    .swap-circle:hover {
        transform: rotate(90deg) scale(1.05);
    }
    
    .currency-card {
        width: 100%;
    }
    
    .rate-value {
        font-size: 1rem;
    }
    
    .amount-input-wrapper input {
        font-size: 1.1rem;
        padding: 0.85rem 2.5rem 0.85rem 1rem;
    }
    
    .header-bg-icons i {
        opacity: 0.1;
    }
}

@media (max-width: 400px) {
    .card-header h1 {
        font-size: 1rem;
    }
    
    .currency-icon-main {
        width: 45px;
        height: 45px;
    }
    
    .currency-icon-main i {
        font-size: 1.3rem;
    }
    
    .rate-value {
        font-size: 0.9rem;
    }
    
    #convertBtn {
        padding: 0.8rem;
        font-size: 0.85rem;
    }
}

/* Remove number input arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
}

/* Smooth transitions */
select, button, .swap-circle, .currency-card {
    transition: all 0.2s ease;
}