* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
}

/* Dynamic Background */
.background {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(-45deg, #2c3e50, #3498db, #2980b9, #1a5276);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    z-index: -2;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Floating Bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(1px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: -1;
    animation: float 8s ease-in-out infinite;
}

.bubble:nth-child(1) { width: 80px; height: 80px; top: 10%; left: 10%; animation-delay: 0s; }
.bubble:nth-child(2) { width: 100px; height: 100px; top: 20%; left: 80%; animation-delay: 1s; }
.bubble:nth-child(3) { width: 60px; height: 60px; top: 80%; left: 20%; animation-delay: 2s; }
.bubble:nth-child(4) { width: 120px; height: 120px; top: 40%; left: 40%; animation-delay: 3s; }
.bubble:nth-child(5) { width: 70px; height: 70px; top: 70%; left: 70%; animation-delay: 4s; }
.bubble:nth-child(6) { width: 90px; height: 90px; top: 30%; left: 60%; animation-delay: 5s; }
.bubble:nth-child(7) { width: 110px; height: 110px; top: 50%; left: 30%; animation-delay: 6s; }
.bubble:nth-child(8) { width: 50px; height: 50px; top: 60%; left: 50%; animation-delay: 7s; }
.bubble:nth-child(9) { width: 85px; height: 85px; top: 90%; left: 90%; animation-delay: 8s; }
.bubble:nth-child(10) { width: 65px; height: 65px; top: 15%; left: 35%; animation-delay: 9s; }

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

.container {
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 600px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 20px;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-weight: 700;
    letter-spacing: 1px;
}

h3 {
    text-align: center;
    margin: 25px 0 15px;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.converter-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.amount-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input {
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

select {
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    background-color: #2c3e50; /* Dark blue to match background gradient */
    color: #ffffff; /* White text for contrast */
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    appearance: none; /* Remove default browser styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>'); /* White arrow for visibility */
    background-repeat: no-repeat;
    background-position: right 10px center;
}

select option {
    background-color: #2c3e50; /* Dark blue for dropdown options */
    color: #ffffff; /* White text for options */
}

input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

input:focus {
    border-color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

select:focus {
    border-color: #3498db; /* Lighter blue to match button gradient */
    background-color: #2980b9; /* Lighter blue for focus state */
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5); /* Blue glow */
    color: #ffffff;
}

.currency-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.from, .to {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 45%;
}

.swap-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.swap-icon:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

button {
    background: linear-gradient(45deg, #2c3e50, #3498db);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

button::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: 0.5s;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.result {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.result:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.result p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.result h2 {
    color: white;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Main Currency Rates Styling */
.main-rates-container {
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 10px;
}

.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.rate-card {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.rate-card:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
}

.rate-card .currency-code {
    font-weight: 700;
    color: white;
    font-size: 16px;
    margin-bottom: 5px;
}

.rate-card .currency-value {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.rate-card .currency-name {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 5px;
}

/* Crypto Prices Styling */
.crypto-prices-container {
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 10px;
}

.crypto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.crypto-card {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.crypto-card:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
}

.crypto-card .crypto-code {
    font-weight: 700;
    color: white;
    font-size: 16px;
    margin-bottom: 5px;
}

.crypto-card .crypto-value {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.crypto-card .crypto-name {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 5px;
}

/* Animation for result update */
@keyframes highlight {
    0% { background-color: rgba(255, 255, 255, 0.5); }
    100% { background-color: rgba(255, 255, 255, 0.2); }
}

.highlight {
    animation: highlight 1s ease-out;
}

/* Notification styling */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
}

.notification.info { background-color: #3498db; }
.notification.success { background-color: #2ecc71; }
.notification.error { background-color: #e74c3c; }
.notification.warning { background-color: #f39c12; }

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

@media (max-width: 600px) {
    .currency-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .from, .to {
        width: 100%;
    }
    
    .swap-icon {
        transform: rotate(90deg);
        margin: 5px 0;
    }
    
    .rates-grid, .crypto-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}