:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --bg-card: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --accent: #007AFF;
    --accent-hover: #0056CC;
    --border: rgba(255, 255, 255, 0.12);
    --success: #34C759;
    --warning: #FF9500;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 20%, rgba(0, 122, 255, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(52, 199, 89, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(255, 149, 0, 0.08) 0%, transparent 50%);
    pointer-events: none;
    animation: subtle-glow 8s ease-in-out infinite alternate;
}

@keyframes subtle-glow {
    0% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

.container {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 2;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.title {
    font-size: 2.2rem;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff 0%, #007AFF 50%, #ffffff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

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

.converter-card {
    background: var(--bg-card);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: var(--glass-border);
    position: relative;
    overflow: hidden;
}

.converter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
    z-index: 1;
}

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

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

.label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-input-wrapper {
    position: relative;
    width: 100%;
}

.custom-input {
    height: 48px;
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.custom-input:focus {
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 122, 255, 0.5);
}

.custom-input:empty::before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.custom-input:focus:empty::before {
    opacity: 0.6;
}

.input {
    width: 100%;
    height: 52px;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 18px;
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    position: relative;
    outline: none;
}

.input::placeholder {
    color: var(--text-secondary);
}

.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.input.error {
    border-color: #ff4444;
    background-color: rgba(255, 68, 68, 0.1);
    animation: shake 0.5s ease-in-out;
}

.custom-input.error {
    border-color: #ff4444 !important;
    background-color: rgba(255, 68, 68, 0.1) !important;
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.3) !important;
    animation: shake 1s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    padding-right: 50px;
    cursor: pointer;
}

.results {
    display: grid;
    gap: 16px;
}

.result-card {
    background: var(--bg-secondary);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 14px;
    padding: 18px;
    border: var(--glass-border);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    margin-bottom: 10px;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
    pointer-events: none;
    z-index: 1;
}

.result-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.result-card:active {
    transform: translateY(-1px);
}

.result-card.active {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(0, 255, 136, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: var(--glass-shadow), 0 0 25px rgba(0, 212, 255, 0.4);
}

.currency-name {
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    opacity: 0.7;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
}

.currency-amount {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.result-card:hover .currency-amount {
    color: #ffffff;
}

/* Disable text selection and copy */
html, body, .container, .converter-card, .results, .result-card, input, select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

@media (max-width: 480px) {
    .converter-card {
        padding: 24px;
    }

    .title {
        font-size: 28px;
    }
}