@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --bg-1: #0f172a;
    --bg-2: #1e293b;
    --card: rgba(15, 23, 42, 0.72);
    --card-border: rgba(255, 255, 255, 0.18);
    --primary: #22c55e;
    --primary-2: #06b6d4;
    --accent: #fb7185;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --surface: rgba(255, 255, 255, 0.08);
    --surface-strong: rgba(255, 255, 255, 0.14);
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
}

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

body {
    font-family: 'Roboto', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.28), transparent 30%),
        radial-gradient(circle at top right, rgba(6, 182, 212, 0.24), transparent 28%),
        radial-gradient(circle at bottom center, rgba(251, 113, 133, 0.18), transparent 32%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2));
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    color: var(--text);
}

#mainForm {
    width: min(100%, 680px);
    padding: 32px;
    border: 1px solid var(--card-border);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0.62));
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#mainForm::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(6, 182, 212, 0.08), rgba(251, 113, 133, 0.12));
    pointer-events: none;
}

#mainForm>* {
    position: relative;
    z-index: 1;
}

#fileInput,
#output,
#goButton,
#copyButton,
#downloadButton {
    font: inherit;
}

#fileInput {
    display: none;
}

#fileInputLabel {
    display: block;
    width: 100%;
    padding: 16px 18px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(6, 182, 212, 0.08));
    color: var(--muted);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
}

#fileInputLabel:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(6, 182, 212, 0.12));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.15);
}

#fileInputLabel:active {
    transform: translateY(0);
}

#fileInputText {
    pointer-events: none;
}

#buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

#goButton {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #04111a;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    flex: 1;
    min-width: 150px;
    box-shadow: 0 14px 30px rgba(34, 197, 94, 0.28);
}

#goButton:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 18px 34px rgba(6, 182, 212, 0.26);
}

#goButton:active {
    transform: translateY(0);
}

#rightButtons {
    display: flex;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
}

#copyButton,
#downloadButton {
    padding: 14px 20px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    min-width: 120px;
}

#copyButton:hover,
#downloadButton:hover {
    background: var(--surface-strong);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.25);
}

#copyButton:active,
#downloadButton:active {
    transform: translateY(0);
}

#output {
    width: 100%;
    min-height: 220px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    font-family: 'Roboto Mono', monospace;
    resize: vertical;
    max-height: 400px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

#output:focus {
    outline: none;
    border-color: rgba(34, 197, 94, 0.75);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 600px) {
    #mainForm {
        padding: 22px;
        border-radius: 22px;
    }

    #buttons {
        flex-direction: column;
        gap: 10px;
    }

    #goButton {
        width: 100%;
    }

    #rightButtons {
        width: 100%;
        justify-content: stretch;
        gap: 8px;
    }

    #copyButton,
    #downloadButton {
        flex: 1;
    }
}