/* Cyberpunk Neon Theme */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Share+Tech+Mono&display=swap');

:root {
    --bg: #0a0b10;
    --grad1: #0f0c29;
    --grad2: #302b63;
    --grad3: #24243e;
    --neon-pink: #ff00ff;
    --neon-cyan: #00fff0;
    --neon-purple: #9b5de5;
    --card: #121320;
    --text: #e6e6ff;
    --muted: #9aa0b4;
    --success: #00ffa3;
    --danger: #ff3b6a;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Share Tech Mono', 'Orbitron', system-ui, -apple-system, sans-serif;
    background: radial-gradient(1000px 600px at 20% 10%, rgba(155, 93, 229, 0.15), transparent),
        radial-gradient(800px 500px at 80% 20%, rgba(0, 255, 240, 0.12), transparent),
        linear-gradient(135deg, var(--grad1), var(--grad2) 50%, var(--grad3));
    color: var(--text);
    min-height: 100vh;
    margin: 0;

    /* 💡 Fix: layout verticale */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    overflow-x: hidden;
    overflow-y: auto;
}


.container {
    width: 100%;
    max-width: 880px;
    max-height: 92vh;
    overflow-y: auto;
    /* scroll verticale solo se necessario */
    overflow-x: hidden;
    /* nasconde scroll orizzontale */
    padding: 36px 28px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(18, 19, 32, 0.85), rgba(18, 19, 32, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 30px rgba(155, 93, 229, 0.15), 0 0 60px rgba(0, 255, 240, 0.08) inset;
    backdrop-filter: blur(6px);
}

.container::-webkit-scrollbar {
    width: 8px;
}

.container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-purple), var(--neon-cyan));
    border-radius: 8px;
}

.container::-webkit-scrollbar-track {
    background: transparent;
}

.title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(36px, 6vw, 68px);
    letter-spacing: 2px;
    margin: 0 0 18px 0;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.8), 0 0 30px rgba(0, 255, 240, 0.5);
}

.title .toast {
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 6px rgba(0, 255, 240, 0.8));
}

.title .translator {
    color: var(--neon-pink);
    filter: drop-shadow(0 0 6px rgba(255, 0, 255, 0.8));
}

.description {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.login-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.add-group {
    display: none;
    flex-direction: row;
    gap: 12px;
    width: 100%;
}

.donation {
    margin-top: 30px;
    text-align: center;
}

.donation img {
    height: 36px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.donation img:hover {
    transform: scale(1.05);
}



input[type="email"],
input[type="password"],
input[type="text"],
textarea,
button,
.addon-info {
    max-width: 100%;
    box-sizing: border-box;
    /* previene overflow orizzontale */
    word-break: break-word;
    /* per testi lunghi */
}

input[type="email"],
input[type="password"],
input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    outline: none;
    transition: 200ms ease;
    box-shadow: 0 0 0px rgba(0, 255, 240, 0);
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 14px rgba(0, 255, 240, 0.3);
}

button {
    padding: 12px 18px;
    font-size: 15px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(155, 93, 229, 0.15), rgba(0, 255, 240, 0.15));
    color: var(--text);
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 200ms ease, background 200ms ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 14px rgba(155, 93, 229, 0.35), 0 0 24px rgba(0, 255, 240, 0.25);
}

.generate-link-btn {
    display: inline-block;
    padding: 6px 12px;
    background-color: #0078d7;
    color: var(--text);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    margin-left: 4px;
    transition: transform 120ms ease, box-shadow 200ms ease, background 200ms ease;
}

.generate-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 14px rgba(155, 93, 229, 0.35), 0 0 24px rgba(0, 255, 240, 0.25);
}

.addon-info {
    background: linear-gradient(180deg, rgba(18, 19, 32, 0.85), rgba(18, 19, 32, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    margin-top: 18px;
    color: var(--text);
    position: relative;
    box-shadow: 0 0 20px rgba(0, 255, 240, 0.06);
    overflow-wrap: break-word;
}

.addon-info::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 14px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.35), rgba(0, 255, 240, 0.3));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.addon-info h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    letter-spacing: 0.5px;
}

.addon-info p {
    margin: 6px 0;
    color: var(--muted);
}

.addon-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.addon-actions button {
    flex: 1 1 auto;
    padding: 10px 14px;
}

.install-btn {
    background: linear-gradient(90deg, rgba(0, 255, 163, 0.18), rgba(0, 255, 240, 0.18));
    color: var(--text);
}

.install-btn:hover {
    box-shadow: 0 0 14px rgba(0, 255, 163, 0.35), 0 0 24px rgba(0, 255, 240, 0.25);
}

.translate-button {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    visibility: hidden;
    flex-wrap: nowrap;
    /* impedisce ai pulsanti di andare a capo */
    overflow-x: auto;
    /* permette scroll orizzontale se necessario */
}

.translate-button button {
    flex: 1 1 auto;
    /* si ridimensionano proporzionalmente */
    min-width: 120px;
    /* evita che diventino troppo piccoli */
    white-space: nowrap;
    /* testo su una riga sola */
    box-sizing: border-box;
}

.addon-logo {
    max-width: 60px;
    max-height: 60px;
    border-radius: 9px;
    margin-right: 10px;
    box-shadow: 0 0 12px rgba(0, 255, 240, 0.2);
}

.addon-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.tsPoster,
.rpdb,
.toast-ratings {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.tsPoster input,
.rpdb input,
.toast-ratings input {
    accent-color: var(--neon-cyan);
    width: 18px;
    height: 18px;
}

.tsPoster label,
.rpdb label,
.toast-ratings label {
    font-size: 13px;
    color: var(--text);
    opacity: 0.9;
}


textarea {
    opacity: 0;
    width: 100%;
    height: 0px;
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.45);
    color: var(--text);
    resize: none;
    outline: none;
    transition: opacity 0.3s, height 0.3s;
    box-shadow: inset 0 0 8px rgba(0, 255, 240, 0.08);
}

textarea[readonly] {
    pointer-events: none;
}

/* Subtle animated glow background */
.container::after {
    content: "";
    position: fixed;
    width: 60vmax;
    height: 60vmax;
    left: -10vmax;
    bottom: -20vmax;
    background: radial-gradient(circle, rgba(255, 0, 255, 0.12), transparent 60%);
    filter: blur(40px);
    z-index: -1;
    animation: floatGlow 12s ease-in-out infinite alternate;
}

/* Link addon */
.addon-list a {
    color: var(--muted);
    position: relative;
    text-decoration: none;
}

.addon-list a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: #00e0ff;
    transition: width 0.3s ease;
}

.addon-list a:hover::after {
    width: 100%;
}

/* TMDB API key e selettore lingua */
.config-group {
    display: none;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.config-group label {
    font-size: 14px;
    color: var(--muted);
    letter-spacing: 0.8px;
    margin-bottom: 4px;
    text-shadow: 0 0 4px rgba(0, 255, 240, 0.3);
}

.config-group.hidden {
    display: none;
}

/* Neon style per il menu a tendina */
select {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    outline: none;
    transition: 200ms ease;
    box-shadow: 0 0 0px rgba(0, 255, 240, 0);
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--neon-cyan) 50%),
        linear-gradient(135deg, var(--neon-cyan) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    cursor: pointer;
}

select:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 14px rgba(0, 255, 240, 0.3);
}

select option {
    background-color: var(--card);
    color: var(--text);
}

/* Miglior spacing verticale dei gruppi input */
.login-group {
    margin-bottom: 20px;
}

/* Neon border quando si passa sopra le label */
.login-group label:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 6px rgba(0, 255, 240, 0.6);
}

/* Github logo */
.github-link {
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 50%;
    transition: transform 0.2s, color 0.2s;
    text-decoration: none;
}

.github-link:hover {
    color: #00e0ff;
    transform: scale(1.1);
}


/* Loader */
.loader {
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top: 6px solid var(--neon-cyan);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    margin: 20px auto;
    animation: spin 1s linear infinite;
    display: none;
}

/* Locader spin */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes floatGlow {
    from {
        transform: translateY(0) translateX(0);
    }

    to {
        transform: translateY(-20px) translateX(30px);
    }
}

/* ===== External Catalog Quick Links (Cinemeta / Kitsu / AnimeCatalog / Trakt) ===== */
:root {
    --neon-red: #ff2e2e;
}

@keyframes redPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 46, 46, 0.55);
    }

    70% {
        box-shadow: 0 0 0 14px rgba(255, 46, 46, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 46, 46, 0);
    }
}

.external-catalogs {
    text-align: center;
    margin-top: 26px;
}

.external-catalogs h4 {
    margin: 0 0 6px 0;
    font-weight: 600;
    letter-spacing: 1px;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--muted);
}

.ext-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.ext-link {
    background: linear-gradient(135deg, #400000, #780909 55%, #400000);
    color: #fff;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 46, 46, 0.55);
    box-shadow: 0 0 6px rgba(255, 46, 46, 0.55), inset 0 0 8px rgba(255, 46, 46, 0.35);
    animation: redPulse 2.1s ease-in-out infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, background .35s ease;
}

.ext-link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity .35s ease;
}

.ext-link:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 12px rgba(255, 46, 46, 0.75), 0 0 24px rgba(255, 46, 46, 0.35), inset 0 0 10px rgba(255, 46, 46, 0.45);
}

.ext-link:hover::after {
    opacity: 1;
}

.ext-link:active {
    transform: translateY(0) scale(.96);
}

.ext-link span {
    background: linear-gradient(90deg, #ffb3b3, #ffe0e0);
    -webkit-background-clip: text;
    background-clip: text;
    color: #fff;
    filter: drop-shadow(0 0 4px rgba(255, 46, 46, 0.65));
}

@media (max-width:600px) {
    .ext-link {
        flex: 1 1 calc(50% - 12px);
        text-align: center;
    }
}

/* Header & Title Container */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

/* Ensure title doesn't have bottom margin as it's handled by container now */
.title {
    margin: 0;
    line-height: 1.1;
}

/* ElfHosted Badge in Header */
.elfhosted-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 14px;
    border-radius: 12px;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.2);
    /* Subtle hover effect */
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.elfhosted-badge:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.elf-logo {
    height: 32px;
    width: auto;
}

.elf-text {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.35;
    margin: 0;
    text-align: right;
}

.elf-link {
    color: #e6e6ff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.elf-link:hover {
    color: var(--neon-cyan);
    text-decoration: underline;
}

@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .elfhosted-badge {
        width: 100%;
        justify-content: center;
    }

    .elf-text {
        text-align: left;
    }
}
