/**
 * Widget flotante de Peticiones de Anime
 */

/* ── Botón flotante ── */

.anime-request-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.anime-request-toggle {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #463759;
    border: none;
    box-shadow: 0 4px 16px rgba(70, 55, 89, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.anime-request-toggle:hover {
    background: #5a4870;
    box-shadow: 0 6px 20px rgba(70, 55, 89, 0.55);
    transform: scale(1.06);
}

.anime-request-toggle svg {
    width: 24px;
    height: 24px;
}

/* Badge tooltip */
.anime-request-badge {
    position: absolute;
    top: -34px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e1e;
    color: rgba(255, 255, 255, 0.85);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, top 0.2s ease;
}

.anime-request-toggle:hover .anime-request-badge {
    opacity: 1;
    top: -38px;
}

/* Ocultar botón cuando el formulario está abierto */
.anime-request-widget.open .anime-request-toggle {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
}

/* ── Contenedor del formulario ── */

.anime-request-form-container {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 75vh !important;
    animation: slideInUp 0.25s ease-out;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.anime-request-form-container::-webkit-scrollbar {
    width: 6px;
}

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

.anime-request-form-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.anime-request-widget.open .anime-request-form-container {
    bottom: 0;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Header ── */

.anime-request-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: #1a1a1a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.anime-request-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
}

.anime-request-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: background 0.15s ease, color 0.15s ease;
}

.anime-request-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.anime-request-close svg {
    width: 14px;
    height: 14px;
}

/* ── Descripción ── */

.anime-request-description {
    margin: 0;
    padding: 12px 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── Formulario ── */

.anime-request-form {
    padding: 16px 18px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group:last-of-type {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-group .required {
    color: #8a6ea8;
    margin-left: 2px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.85);
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.form-group input[type="text"]::placeholder,
.form-group input[type="email"]::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #463759;
    background: #111;
}

.form-group textarea {
    resize: vertical;
    min-height: 72px;
}

/* ── Mensajes de estado ── */

.anime-request-message {
    margin-bottom: 12px;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 12px;
    display: none;
    line-height: 1.4;
}

.anime-request-message.success {
    display: block;
    background: rgba(102, 234, 128, 0.08);
    color: #6ee79c;
    border: 1px solid rgba(102, 234, 128, 0.15);
}

.anime-request-message.error {
    display: block;
    background: rgba(234, 102, 102, 0.08);
    color: #f08080;
    border: 1px solid rgba(234, 102, 102, 0.15);
}

/* ── Botón enviar ── */

.anime-request-submit {
    width: 100%;
    padding: 10px 16px;
    background: #463759;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 0.01em;
}

.anime-request-submit:hover {
    background: #5a4870;
    box-shadow: 0 4px 14px rgba(70, 55, 89, 0.4);
}

.anime-request-submit:active {
    background: #38294a;
    box-shadow: none;
}

.anime-request-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── Responsive ── */

@media (max-width: 480px) {
    .anime-request-widget {
        bottom: 16px;
        right: 16px;
    }

    .anime-request-toggle {
        width: 52px;
        height: 52px;
    }

    .anime-request-toggle svg {
        width: 22px;
        height: 22px;
    }

    .anime-request-form-container {
        width: calc(100vw - 32px);
        bottom: 68px;
    }

    .anime-request-widget.open .anime-request-form-container {
        bottom: 0;
    }
}