:root {
    --mountain-mist: #9fb4c7;
    --deep-mist: #7a93ab;
    --ice-blue: #c8d9e6;
    --slate-blue: #5a7a99;
    --moss-green: #6b8e6f;
    --dark-moss: #4a6b4d;
    --cloud-white: #f5f8fa;
    --shadow-blue: rgba(90, 122, 153, 0.15);
    --mountain-grey: #7a8088;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(90, 100, 120, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(70, 80, 100, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(50, 60, 80, 0.2) 0%, transparent 50%);
    animation: drift 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-5%, -5%); } }

.container { position: relative; z-index: 1; width: 100%; max-width: 700px; }

.tool-box {
    background: rgba(122, 128, 136, 0.75);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 4rem 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-box:hover { box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15) inset; transform: translateY(-2px); }

.page-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0 2px 20px rgba(107, 142, 111, 0.3);
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--moss-green), transparent);
    box-shadow: 0 0 10px rgba(107, 142, 111, 0.5);
}

.input-group { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 3rem; }
.input-wrapper { flex: 1; position: relative; }
.input-label { font-size: 0.875rem; color: rgba(255, 255, 255, 0.9); margin-bottom: 0.5rem; display: block; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; }

input[type="text"] {
    width: 100%;
    padding: 1rem 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.125rem;
    font-weight: 500;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="text"]:focus { outline: none; border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.15); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05); }
input[type="text"]::placeholder { color: rgba(255, 255, 255, 0.5); opacity: 1; text-transform: none; letter-spacing: 0.5px; }

.submit-btn {
    padding: 1rem;
    background: var(--slate-blue);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(90, 122, 153, 0.25);
    min-width: 60px;
    margin-top: 1.5rem;
}

.submit-btn:hover { background: var(--deep-mist); transform: translateX(-4px); box-shadow: 0 6px 20px rgba(90, 122, 153, 0.35); }
.submit-btn:active { transform: translateX(-2px) scale(0.98); }
.submit-btn.loading { pointer-events: none; opacity: 0.7; }

.arrow { width: 32px; height: 32px; stroke: white; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; animation: arrowPulse 2s ease-in-out infinite; }

@keyframes arrowPulse { 0%, 100% { transform: translateX(0); opacity: 1; } 50% { transform: translateX(-6px); opacity: 0.8; } }

.submit-btn:hover .arrow { animation: arrowSlide 0.6s ease-in-out infinite; }
@keyframes arrowSlide { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-8px); } }

.output {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--moss-green);
    min-height: 200px;
    opacity: 0.95;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.output.visible { opacity: 1; transform: translateY(0); }

.output-line {
    margin-bottom: 0.75rem;
    opacity: 0;
    transform: translateX(-10px);
    animation: fadeInLine 0.4s ease forwards;
    filter: drop-shadow(0 0 8px rgba(107, 142, 111, 0.3));
}

.output-line:nth-child(1) { animation-delay: 0.1s; }
.output-line:nth-child(2) { animation-delay: 0.2s; }
.output-line:nth-child(3) { animation-delay: 0.3s; }
.output-line:nth-child(4) { animation-delay: 0.4s; }
.output-line:nth-child(5) { animation-delay: 0.5s; }
.output-line:nth-child(6) { animation-delay: 0.6s; }
.output-line:nth-child(7) { animation-delay: 0.7s; }

@keyframes fadeInLine {
    0% { opacity: 0; transform: translateX(-10px); filter: blur(2px); }
    100% { opacity: 1; transform: translateX(0); filter: blur(0); }
}

.output-label { color: rgba(127, 178, 133, 0.7); margin-right: 1rem; display: inline-block; min-width: 160px; }
.output-value { color: rgba(127, 178, 133, 0.7); font-weight: 500; text-shadow: 0 0 10px rgba(107, 142, 111, 0.7); }
.output-value.positive { color: #7fb285; text-shadow: 0 0 10px rgba(127, 178, 133, 0.7); }
.output-value.negative { color: #d88b8b; text-shadow: 0 0 10px rgba(216, 139, 139, 0.7); }

.output-prompt { color: rgba(127, 178, 133, 0.7); margin-right: 0.5rem; text-shadow: 0 0 10px rgba(107, 142, 111, 0.7); }
.error-message { color: #d88b8b; font-weight: 500; text-shadow: 0 0 10px rgba(216, 139, 139, 0.7); }

.loading-dots { display: inline-block; width: 60px; }
.loading-dots span { animation: blink 1.4s infinite; display: inline-block; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink { 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } }

.spinner {
    width: 24px;
    height: 24px;
    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); } }

@media (max-width: 640px) {
    .tool-box { padding: 2.5rem 1.5rem; }
    .input-group { flex-direction: column; align-items: stretch; }
    .submit-btn { margin-top: 0; }
}
