:root {
    /* Color Palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;

    /* Neutrals */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.3);
    --glow: 0 0 30px rgba(99, 102, 241, 0.3);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
}

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

/* Remove number input arrows */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Decoration */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 500px;
    height: 500px;
    top: -10%;
    right: -10%;
    animation-delay: 0s;
}

.circle-2 {
    width: 400px;
    height: 400px;
    bottom: -10%;
    left: -5%;
    animation-delay: 7s;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, transparent 70%);
}

.circle-3 {
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Main Wrapper */
.main-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Container - Glassmorphism Card */
.container {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-xl), var(--glow);
    max-width: 480px;
    width: 100%;
    margin: 0 auto 3rem;
    transition: all 0.3s ease;
}

.container:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 40px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    margin-bottom: 0.75rem;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 30px rgba(99, 102, 241, 0.6);
    }
}

.icon-wrapper i {
    font-size: 1.75rem;
    color: white;
}

h1 {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

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

/* Form */
form {
    animation: fadeIn 0.8s ease-out 0.4s both;
}

/* Amount Section */
.amount-section {
    margin-bottom: 1.25rem;
}

.amount-section label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

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

.currency-symbol {
    position: absolute;
    left: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    pointer-events: none;
}

input[type="number"] {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.3s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: rgba(99, 102, 241, 0.05);
}

input[type="number"]::placeholder {
    color: var(--text-muted);
}

/* Exchange Container */
.exchange-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1.25rem;
}

/* Currency Box */
.currency-box label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.select-wrapper:hover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.05);
}

.select-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.flag-container {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

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

.currency-select {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    outline: none;
    appearance: none;
    padding-right: 1.5rem;
}

.currency-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
}

.select-arrow {
    position: absolute;
    right: 0.875rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.select-wrapper:hover .select-arrow {
    color: var(--primary);
    transform: translateY(2px);
}

/* Swap Button */
.swap-btn {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    align-self: center;
}

.swap-btn:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.swap-btn:active {
    transform: rotate(180deg) scale(0.95);
}

/* Result Box */
.result-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.msg {
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    line-height: 1.5;
}

.msg:empty::before {
    content: "Enter an amount to see conversion";
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

/* Convert Button */
.convert-btn {
    width: 100%;
    padding: 1rem 1.75rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.convert-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.5);
}

.convert-btn:hover::before {
    left: 100%;
}

.convert-btn:active {
    transform: translateY(0);
}

.convert-btn i {
    transition: transform 0.3s ease;
}

.convert-btn:hover i {
    transform: translateX(5px);
}

/* Info Badge */
.info-badge {
    margin-top: 1rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    animation: fadeIn 0.8s ease-out 0.6s both;
}

.info-badge i {
    color: var(--success);
}

/* About Section */
.about-section {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.about-content h2 {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.feature-icon i {
    font-size: 1.5rem;
    color: white;
}

.feature-card h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.about-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    .container {
        padding: 1.5rem 1.25rem;
        max-width: 100%;
    }

    h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .exchange-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .swap-btn {
        transform: rotate(90deg);
        justify-self: center;
        order: 2;
    }

    .from-currency {
        order: 1;
    }

    .to-currency {
        order: 3;
    }

    .swap-btn:hover {
        transform: rotate(270deg) scale(1.1);
    }

    input[type="number"] {
        font-size: 1.125rem;
        padding: 0.875rem 0.875rem 0.875rem 2.5rem;
    }

    .currency-symbol {
        font-size: 1.125rem;
        left: 0.875rem;
    }

    .msg {
        font-size: 1rem;
    }

    .about-section {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }

    .about-content h2 {
        font-size: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card {
        padding: 1.25rem;
    }

    .circle-1 {
        width: 350px;
        height: 350px;
    }

    .circle-2 {
        width: 300px;
        height: 300px;
    }

    .circle-3 {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.75rem 0.5rem;
    }

    .container {
        padding: 1.25rem 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .icon-wrapper {
        width: 50px;
        height: 50px;
    }

    .icon-wrapper i {
        font-size: 1.5rem;
    }

    .convert-btn {
        font-size: 0.95rem;
        padding: 0.875rem 1.5rem;
    }

    input[type="number"] {
        font-size: 1rem;
        padding: 0.75rem 0.75rem 0.75rem 2.25rem;
    }

    .currency-symbol {
        font-size: 1rem;
        left: 0.75rem;
    }

    .select-wrapper {
        padding: 0.625rem 0.75rem;
    }

    .flag-container {
        width: 24px;
        height: 24px;
    }

    .currency-select {
        font-size: 0.875rem;
    }

    .swap-btn {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    .result-box {
        padding: 0.875rem;
        min-height: 60px;
    }

    .msg {
        font-size: 0.95rem;
    }

    .about-section {
        padding: 1.25rem;
    }

    .about-content h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .feature-icon {
        width: 45px;
        height: 45px;
    }

    .feature-icon i {
        font-size: 1.25rem;
    }

    .feature-card h3 {
        font-size: 1.125rem;
    }

    .feature-card p {
        font-size: 0.875rem;
    }

    .about-description {
        font-size: 0.9rem;
    }

    .circle-1 {
        width: 250px;
        height: 250px;
    }

    .circle-2 {
        width: 200px;
        height: 200px;
    }

    .circle-3 {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 1rem 0.875rem;
    }

    h1 {
        font-size: 1.35rem;
    }

    .exchange-container {
        gap: 0.875rem;
    }

    .convert-btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }

    input[type="number"] {
        font-size: 0.95rem;
    }

    .currency-select {
        font-size: 0.8rem;
    }
}

/* Landscape orientation fixes */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 1rem;
    }

    .container {
        margin-bottom: 1.5rem;
    }

    .icon-wrapper {
        width: 50px;
        height: 50px;
        margin-bottom: 0.5rem;
    }

    .icon-wrapper i {
        font-size: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .header {
        margin-bottom: 1rem;
    }

    .about-section {
        padding: 1.25rem;
    }

    .circle {
        display: none;
    }
}

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

.loading .convert-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: 2rem;
    animation: fadeIn 0.8s ease-out 0.8s both;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 400;
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.footer a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.footer a:hover {
    color: var(--secondary);
}

.footer a:hover::after {
    width: 100%;
}

@media (max-width: 480px) {
    .footer {
        padding: 1rem;
        margin-top: 1.5rem;
    }

    .footer p {
        font-size: 0.85rem;
    }
}