/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-gradient: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --accent-color: #00d4ff;
    --success-color: #00ff88;
    --error-color: #ff3366;
    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.5);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(0, 212, 255, 0.2) 0%, transparent 50%);
    animation: backgroundShift 15s ease infinite;
    pointer-events: none;
}

@keyframes backgroundShift {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
        opacity: 0.8;
    }
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.header-content {
    position: relative;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 1rem;
}

.title-underline {
    width: 100px;
    height: 4px;
    background: var(--primary-gradient);
    margin: 0 auto;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.8);
}

/* Calculator Card */
.calculator-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out 0.2s both;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        var(--shadow-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    animation: rotateGlow 10s linear infinite;
    pointer-events: none;
}

@keyframes rotateGlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Form */
.calculator-form {
    position: relative;
    z-index: 1;
}

.input-group {
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease-out;
}

.input-group:nth-child(1) { animation-delay: 0.3s; }
.input-group:nth-child(2) { animation-delay: 0.4s; }
.input-group:nth-child(3) { animation-delay: 0.5s; }

.input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-icon {
    font-size: 1.2rem;
}

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

.input-field {
    width: 100%;
    padding: 1rem 3.5rem 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1), 0 0 20px rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

.input-field:invalid:not(:placeholder-shown),
.input-field.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 4px rgba(255, 51, 102, 0.1), 0 0 20px rgba(255, 51, 102, 0.3);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.input-suffix {
    position: absolute;
    right: 1.25rem;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 1rem;
    pointer-events: none;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease-out 0.6s both;
}

.btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-calculate {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.btn-reset {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-icon {
    position: relative;
    z-index: 1;
    font-size: 1.1rem;
}

/* Result Section */
.result-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.6s ease-out 0.7s both;
    transition: all 0.3s ease;
}

.result-section.has-result {
    border-color: var(--success-color);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
    background: rgba(0, 255, 136, 0.05);
}

.result-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-icon {
    font-size: 1.3rem;
}

.result-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.result-currency {
    font-size: 1.5rem;
    color: var(--accent-color);
    font-weight: 600;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.result-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    line-height: 1.6;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    animation: fadeIn 0.8s ease-out 0.8s both;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .calculator-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .button-group {
        flex-direction: column;
    }

    .result-value {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.75rem;
    }

    .calculator-card {
        padding: 1.25rem;
    }

    .input-field {
        font-size: 1rem;
        padding: 0.875rem 3rem 0.875rem 1rem;
    }
}