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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: #334155;
    --success: #10b981;
    --warning: #f59e0b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1f35 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 16px;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    padding: 24px 0 16px;
}

header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Input Section */
.input-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
}

.input-group {
    margin-bottom: 16px;
}

.input-group label,
.currency-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#amount {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

#amount:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Currency Row */
.currency-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.currency-group {
    flex: 1;
}

.currency-group select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.currency-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.currency-group select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* Swap Button */
.swap-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.swap-btn:active {
    background: var(--primary-dark);
    transform: scale(0.95);
}

/* Result Section */
.result-section {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.result-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.result-value {
    font-size: 48px;
    font-weight: 700;
    color: white;
    word-break: break-all;
}

.result-currency {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* Rate Info */
.rate-info {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.rate-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rate-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

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

/* Quick Convert */
.quick-convert {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
}

.quick-convert h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-btn {
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.quick-btn:active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(0.98);
}

/* Footer */
footer {
    text-align: center;
    padding: 24px 0 16px;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}

footer p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0;
}

.version {
    font-size: 11px;
    opacity: 0.6;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    header h1 {
        font-size: 28px;
    }

    .result-value {
        font-size: 40px;
    }

    .quick-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Input number spinner hide */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}
