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

body {
    font-family: 'Rajdhani', sans-serif;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    /* Animated Gradient Background */
    background: linear-gradient(280deg, #0f0f1a, #1a1a2e, #2a1a3a, #0f0f1a); /* Added purple hint */
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Calculator Container --- */
.calculator-container {
    background-color: rgba(15, 15, 26, 0.85); /* Slightly darker, more opaque */
    padding: 35px 45px; /* Slightly larger padding */
    border-radius: 20px; /* More rounded */
    border: 1px solid rgba(0, 255, 255, 0.3);
    position: relative; /* Needed for pseudo-elements if added later */
    width: 100%;
    max-width: 600px; /* Slightly wider */
    text-align: center;
    animation: fadeIn 1s ease-out;
    /* Enhanced Pulsating Glow */
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2), /* Base cyan glow */
                0 0 30px rgba(0, 0, 0, 0.6);   /* Base dark shadow */
    animation: fadeIn 1s ease-out, containerPulse 4s infinite alternate;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes containerPulse {
    from {
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.2),
                    0 0 25px rgba(255, 223, 0, 0.1), /* Faint gold pulse */
                    0 0 35px rgba(0, 0, 0, 0.6);
        border-color: rgba(0, 255, 255, 0.3);
    }
    to {
        box-shadow: 0 0 25px rgba(0, 255, 255, 0.4), /* Brighter cyan */
                    0 0 40px rgba(255, 223, 0, 0.25),/* Brighter gold pulse */
                    0 0 50px rgba(0, 0, 0, 0.7);   /* Deeper shadow */
        border-color: rgba(0, 255, 255, 0.5);
    }
}

/* --- Typography --- */
h1 {
    font-family: 'Orbitron', sans-serif;
    color: #FFF; /* Base white for gradient */
    margin-bottom: 10px;
    font-size: 2.8em; /* Larger */
    letter-spacing: 3px;
    position: relative; /* For potential pseudo elements */
     /* Animated Gradient Text */
    background: linear-gradient(90deg, #00ffff, #ffffff, #ffd700, #00ffff);
    background-size: 200% auto;
    color: transparent; /* Hide the base white */
    background-clip: text;
    -webkit-background-clip: text;
    animation: textShine 5s linear infinite, titlePulse 2s infinite alternate;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5),
                 0 0 10px rgba(0, 255, 255, 0.3),
                 0 0 15px rgba(255, 223, 0, 0.2); /* Added gold shadow hint */
}

@keyframes textShine {
    to {
        background-position: -200% center;
    }
}

@keyframes titlePulse { /* More pronounced pulsing */
    from {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(0, 255, 255, 0.5),
                     0 0 10px rgba(0, 255, 255, 0.3),
                     0 0 15px rgba(255, 223, 0, 0.2);
    }
    to {
        transform: scale(1.03); /* Slight size increase */
        text-shadow: 0 0 8px rgba(0, 255, 255, 0.8), /* Brighter cyan */
                     0 0 18px rgba(0, 255, 255, 0.5),
                     0 0 25px rgba(255, 223, 0, 0.4); /* Brighter gold */
    }
}


.subtitle {
    color: #b0b0d0; /* Slightly brighter */
    margin-bottom: 35px;
    font-size: 1.15em;
}

/* --- Input Grid & Groups --- */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Wider min width */
    gap: 30px; /* Increased gap */
    margin-bottom: 35px;
}

.input-group {
    text-align: left;
    position: relative;
}

label {
    display: block;
    margin-bottom: 10px; /* More space */
    color: #00ffff;
    font-weight: 600;
    font-size: 1em; /* Slightly larger */
    text-transform: uppercase;
    letter-spacing: 1.5px; /* More spacing */
     text-shadow: 0 0 2px rgba(0, 255, 255, 0.5);
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: #101020; /* Darker input bg */
    border: 1px solid #404065; /* Slightly stronger border */
    border-radius: 8px; /* More rounded inputs */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative; /* For potential inner glows */
}

.input-wrapper:focus-within {
     border-color: #FFD700; /* Gold focus border */
     /* Multi-layered neon glow on focus */
     box-shadow: 0 0 8px rgba(0, 255, 255, 0.6),  /* Cyan outer */
                 0 0 15px rgba(255, 223, 0, 0.5), /* Gold inner */
                 inset 0 0 5px rgba(0, 255, 255, 0.2); /* Subtle inner cyan */
     animation: focusPulse 1s infinite alternate; /* Add pulse on focus */
}

@keyframes focusPulse {
    from {
         box-shadow: 0 0 8px rgba(0, 255, 255, 0.6),
                     0 0 15px rgba(255, 223, 0, 0.5),
                     inset 0 0 5px rgba(0, 255, 255, 0.2);
    }
    to {
         box-shadow: 0 0 12px rgba(0, 255, 255, 0.8), /* Brighter cyan */
                     0 0 22px rgba(255, 223, 0, 0.7), /* Brighter gold */
                     inset 0 0 8px rgba(0, 255, 255, 0.3); /* Brighter inner cyan */
    }
}


.input-wrapper span {
    padding: 0 12px; /* More padding */
    color: #a0a0c0;
    font-weight: 700; /* Bolder symbol */
     font-size: 1.1em;
}

input[type="number"] {
    flex-grow: 1;
    width: 100%;
    background-color: transparent;
    border: none;
    color: #e8e8ff; /* Brighter input text */
    padding: 14px 12px; /* More padding */
    font-size: 1.15em; /* Larger font */
    font-family: 'Rajdhani', sans-serif;
    outline: none;
    border-radius: 8px;
    appearance: textfield;
    -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]::placeholder {
    color: #555577; /* Slightly lighter placeholder */
    font-style: italic;
    font-size: 0.9em;
}

/* Highlight calculated fields */
input.calculated {
    /* Use box-shadow for highlight instead of background for better blending */
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.3);
    color: #c0ffff; /* Lighter cyan text */
    animation: highlightCalc 0.8s ease-out;
    transition: box-shadow 0.3s ease, color 0.3s ease; /* Add transition */
}

@keyframes highlightCalc {
    0% { box-shadow: inset 0 0 15px rgba(0, 255, 255, 0.5); transform: scale(1.01); }
    100% { box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.3); transform: scale(1); }
}

/* --- Controls --- */
.controls {
    display: flex;
    justify-content: center;
    gap: 25px; /* More gap */
    margin-bottom: 25px;
}

.btn {
    padding: 15px 35px; /* Larger buttons */
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1em; /* Larger font */
    font-weight: 700;
    border: none; /* Keep border none, use gradients/shadows */
    border-radius: 8px; /* Match inputs */
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background-position 0.4s ease; /* Add background transition */
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden; /* Needed for potential shine effects */
    background-size: 200% auto; /* For gradient animation */
}

.btn::before { /* Optional: Add subtle shine effect */
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    transition: left 0.5s ease, top 0.5s ease;
    opacity: 0;
}

.btn:hover::before {
   /* opacity: 1; */ /* Enable this for a shine wipe effect on hover - can be too much */
}

.btn-calculate {
    /* Vegas Gold/Cyan Gradient */
    background-image: linear-gradient(to right, #00aaaa 0%, #00ffff 50%, #ffd700 100%);
    color: #0f0f1a; /* Dark text for contrast */
    box-shadow: 0 0 10px rgba(0, 200, 200, 0.5), 0 0 15px rgba(255, 215, 0, 0.3);
}

.btn-calculate:hover {
    background-position: right center; /* Shift gradient on hover */
    transform: translateY(-3px) scale(1.03); /* More hover effect */
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.7), 0 0 25px rgba(255, 215, 0, 0.5); /* Brighter shadow */
}

.btn-calculate:active {
     transform: translateY(0px) scale(1);
     background-position: left center; /* Reset gradient position */
     box-shadow: 0 0 8px rgba(0, 200, 200, 0.4), 0 0 12px rgba(255, 215, 0, 0.2); /* Dimmer shadow on click */
}

.btn-reset {
    /* Purple/Grey Gradient */
    background-image: linear-gradient(to right, #444466 0%, #666688 50%, #555577 100%);
    color: #d0d0f0; /* Lighter text */
    box-shadow: 0 0 8px rgba(80, 80, 120, 0.4);
}

.btn-reset:hover {
    background-position: right center;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 0 12px rgba(100, 100, 140, 0.6);
}

.btn-reset:active {
     transform: translateY(0px) scale(1);
     background-position: left center;
     box-shadow: 0 0 6px rgba(80, 80, 120, 0.3);
}


/* --- Status Message --- */
.status-message {
    min-height: 1.5em; /* More space for larger font */
    margin-top: 20px;
    font-size: 1.1em; /* Larger status */
    font-weight: 600;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5); /* Basic text shadow */
}

.status-message.error {
    color: #ff6666;
    text-shadow: 0 0 5px rgba(255, 100, 100, 0.7); /* Red glow */
    animation: shake 0.5s ease;
}

.status-message.success {
     color: #66ff66;
     text-shadow: 0 0 5px rgba(100, 255, 100, 0.7); /* Green glow */
}

.status-message.status { /* Style for generic status messages */
     color: #aaaacc; /* Neutral color */
     font-style: italic;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 90% { transform: translateX(-4px); } /* Adjusted shake */
  30%, 70% { transform: translateX(4px); }
  50% { transform: translateX(-4px); }
}

/* --- Responsive Design --- */
@media (max-width: 650px) { /* Adjusted breakpoint */
    .calculator-container {
        padding: 25px 20px; /* Adjust padding for smaller screens */
        margin: 10px;
        border-radius: 15px; /* Slightly less rounding */
    }

    h1 {
        font-size: 2.2em; /* Adjust title size */
    }

    .subtitle {
        font-size: 1.05em;
        margin-bottom: 25px;
    }

    .input-grid {
        grid-template-columns: 1fr; /* Stack inputs */
        gap: 25px;
    }

    .controls {
        flex-direction: column;
        gap: 18px;
    }

    .btn {
        width: 100%;
        padding: 14px 20px; /* Adjust button padding */
        font-size: 1em;
    }
}