/* ============================================================
   Favoritos Novelas — CSS
   Theme: Series (fondo #113A7D, rojo #fe0000, acento #ff00ff)
   ============================================================ */

/* ---- Botón flotante ---- */
.fav-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 9999;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fe0000 0%, #cc0000 100%);
    box-shadow: 0 4px 20px rgba(254, 0, 0, 0.55), 0 2px 8px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.fav-toggle-btn:hover,
.fav-toggle-btn:active {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(254, 0, 0, 0.7), 0 3px 12px rgba(0,0,0,0.6);
}

.fav-star-icon {
    font-size: 32px;
    line-height: 1;
    color: #ffe600;
    text-shadow: 0 1px 6px rgba(255, 230, 0, 0.7);
    display: block;
    animation: fav-pulse-star 2.5s ease-in-out infinite;
}

@keyframes fav-pulse-star {
    0%, 100% { text-shadow: 0 1px 6px rgba(255, 230, 0, 0.7); }
    50%       { text-shadow: 0 2px 16px rgba(255, 230, 0, 1), 0 0 30px rgba(255,200,0,0.5); }
}

/* Badge contador */
.fav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    background: #ff00ff;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Roboto Condensed', sans-serif;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #113A7D;
    box-shadow: 0 2px 8px rgba(255,0,255,0.6);
    animation: fav-badge-pop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes fav-badge-pop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* ---- Panel de favoritos ---- */
.fav-panel {
    position: fixed;
    bottom: 96px;
    right: 16px;
    z-index: 9998;
    width: 300px;
    max-width: calc(100vw - 32px);
    max-height: 70vh;
    border-radius: 16px;
    background: #0d2d63;
    border: 1px solid rgba(255, 0, 255, 0.25);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255,255,255,0.05),
        inset 0 1px 0 rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fav-panel-in 0.25s cubic-bezier(0.34,1.3,0.64,1) both;
    transform-origin: bottom right;
}

@keyframes fav-panel-in {
    from { transform: scale(0.7); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.fav-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    background: linear-gradient(90deg, #fe0000 0%, #cc0000 100%);
    flex-shrink: 0;
}

.fav-panel-title {
    color: #fff;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fav-star-icon-sm {
    font-size: 20px;
    color: #ffe600;
    text-shadow: 0 1px 6px rgba(255, 230, 0, 0.8);
}

.fav-close-btn {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
    padding: 0;
    font-family: 'Roboto Condensed', sans-serif;
}

.fav-close-btn:hover {
    background: rgba(255,255,255,0.35);
}

/* Body del panel */
.fav-panel-body {
    overflow-y: auto;
    flex: 1;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,0,255,0.4) transparent;
}

.fav-panel-body::-webkit-scrollbar { width: 4px; }
.fav-panel-body::-webkit-scrollbar-thumb {
    background: rgba(255,0,255,0.4);
    border-radius: 4px;
}

/* Estado vacío */
.fav-empty {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255,255,255,0.5);
    font-family: 'Roboto Condensed', sans-serif;
}

.fav-empty-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
    color: rgba(255,230,0,0.3);
}

.fav-empty p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Lista de favoritos */
.fav-list {
    list-style: none;
    margin: 0;
    padding: 0 10px;
}

.fav-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 10px;
    transition: background 0.15s;
    animation: fav-item-in 0.25s ease both;
}

@keyframes fav-item-in {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.fav-list-item:hover {
    background: rgba(255,255,255,0.07);
}

.fav-item-poster {
    width: 42px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.fav-item-poster-placeholder {
    width: 42px;
    height: 60px;
    border-radius: 6px;
    background: rgba(17,58,125,0.8);
    border: 1px solid rgba(255,0,255,0.2);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: rgba(255,230,0,0.4);
}

.fav-item-info {
    flex: 1;
    min-width: 0;
}

.fav-item-title {
    display: block;
    color: #fff;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.fav-item-title:hover {
    color: #ffe600;
}

.fav-item-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.fav-item-remove:hover {
    color: #fe0000;
    background: rgba(254,0,0,0.12);
}

/* ---- Botón estrella en tarjetas ---- */
.fav-card-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: rgba(255,255,255,0.35);
    transition: color 0.2s, transform 0.2s;
    vertical-align: middle;
    margin-left: 5px;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.fav-card-star:hover {
    color: #ffe600;
    transform: scale(1.2);
}

.fav-card-star.is-fav {
    color: #ffe600;
    text-shadow: 0 1px 8px rgba(255,230,0,0.8);
    animation: fav-star-pop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes fav-star-pop {
    0%   { transform: scale(0.5); }
    60%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .fav-toggle-btn {
        bottom: 18px;
        right: 14px;
        width: 56px;
        height: 56px;
    }
    .fav-star-icon { font-size: 28px; }
    .fav-panel {
        bottom: 86px;
        right: 10px;
        width: calc(100vw - 20px);
        max-width: 340px;
    }
}
