:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #10b981;
    --background-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 16px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-family);
    background: var(--background-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-main);
}

.app-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    position: relative;
}

/* Header */
header {
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Exchange Rate Display */
.rate-display {
    background: #f3f4f6;
    padding: 16px;
    margin: 24px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rate-item {
    text-align: center;
    flex: 1;
}

.rate-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.rate-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
    margin: 0 16px;
}

/* Converter Form */
.converter {
    padding: 0 24px 24px;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 16px;
    font-size: 1.125rem;
    color: var(--text-secondary);
    pointer-events: none;
}

input[type="number"] {
    width: 100%;
    padding: 16px 16px 16px 40px;
    font-size: 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    outline: none;
    background: #fff;
    font-family: var(--font-family);
    font-weight: 500;
}

input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Toggle Switch */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.checkbox-wrapper:hover {
    border-color: var(--border-color);
    background: #f3f4f6;
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    flex: 1;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Swap Button */
.swap-container {
    display: flex;
    justify-content: center;
    margin: -10px 0 10px;
    position: relative;
    z-index: 10;
}

.btn-swap {
    background: #fff;
    border: 2px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--primary-color);
}

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

.btn-swap svg {
    width: 20px;
    height: 20px;
}

/* Result Section */
.result-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    margin-top: 24px;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.result-row.total {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 0;
    font-size: 1.1rem;
    font-weight: 700;
    opacity: 1;
}

.result-value {
    font-family: monospace;
    font-size: 1.1em;
}

/* Footer */
footer {
    text-align: center;
    padding: 16px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: #f9fafb;
    border-top: 1px solid var(--border-color);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .app-container {
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }
}