@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-blur: 15px;
    --accent: #4f46e5;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Background Blobs */
.bg-blobs {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: var(--primary-gradient);
    filter: blur(120px);
    border-radius: 50%;
    opacity: 0.1;
    animation: floating 25s infinite alternate;
}

.blob-2 {
    right: -10%;
    bottom: -10%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation-delay: -12s;
}

@keyframes floating {
    from { transform: translate(-5%, -5%); }
    to { transform: translate(10%, 10%); }
}

/* Calculator Card */
.calculator-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    width: 95%;
    max-width: 550px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    margin-bottom: 30px;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 10px;
}

header p {
    color: #94a3b8;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Form Styles */
.calc-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.label-row label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.info-icon, .pin-icon {
    font-size: 0.75rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    color: #94a3b8;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.5);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 16px;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    outline: none;
    width: 100%;
}

.input-wrapper.read-only {
    background: rgba(255, 255, 255, 0.02);
}

.input-wrapper.highlight input {
    color: var(--success);
    font-weight: 800;
    font-size: 1.4rem;
}

/* Suffix & Dropdown */
.input-suffix {
    padding-right: 16px;
    color: var(--accent);
    font-weight: 600;
}

.currency-dropdown {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-left: 1px solid var(--border-color);
}

.currency-dropdown select {
    appearance: none;
    background: transparent;
    border: none;
    padding: 14px 35px 14px 15px;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
    outline: none;
}

.currency-dropdown .chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--accent);
    pointer-events: none;
}

/* Slider */
.slider {
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-top: 8px;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

/* Split Section */
.split-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-wrapper label {
    font-size: 0.9rem;
    color: #94a3b8;
    cursor: pointer;
}

.split-inputs-container {
    margin-top: 20px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.split-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.split-res-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.split-res-item span {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 5px;
}

.split-res-item strong {
    font-size: 1.1rem;
    color: white;
}

/* Exchange Info */
.exchange-info {
    background: rgba(79, 70, 229, 0.05);
    border: 1px solid rgba(79, 70, 229, 0.1);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.rate-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
}

.sync-icon {
    color: var(--accent);
}

.rate-source {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 8px;
}

.rate-source a {
    color: var(--accent);
    text-decoration: none;
}

/* Clear Button */
.clear-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: #64748b;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: 10px;
}

.clear-btn:hover {
    border-color: #f43f5e;
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.05);
}

@media (max-width: 480px) {
    .calculator-card {
        padding: 30px 20px;
    }
    
    .rate-text {
        flex-direction: column;
        gap: 5px;
    }
}
