/* WatchList CSS v1.2 by Defoz */

/* CSS Variables для кастомизации (можно переопределить в шаблоне) */
:root {
    --watchlist-primary-color: #38bdf8;
    --watchlist-primary-rgb: 56, 189, 248;
    --watchlist-primary-weak: rgba(56, 189, 248, 0.1);
    --watchlist-surface: #111a2f;
    --watchlist-surface-alt: rgba(17, 26, 47, 0.6);
    --watchlist-text: #e2e8f0;
    --watchlist-muted: #cbd5e1;
    --watchlist-border: rgba(148, 163, 184, 0.15);
    --watchlist-border-hover: rgba(148, 163, 184, 0.3);
    --watchlist-success: #34d399;
    --watchlist-warning: #fbbf24;
    --watchlist-danger: #f87171;
    --watchlist-radius: 10px;
    --watchlist-radius-lg: 16px;
    --watchlist-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --watchlist-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Widget Container */
.watchlist-widget {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 24px;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

.watchlist-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    background: var(--watchlist-surface-alt, rgba(17, 26, 47, 0.6));
    padding: 10px 16px;
    border-radius: var(--watchlist-radius-lg, 16px);
    border: 1px solid var(--watchlist-border, rgba(148, 163, 184, 0.15));
    backdrop-filter: blur(8px);
}

/* Buttons */
.watchlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--watchlist-radius, 10px);
    color: var(--watchlist-muted, #cbd5e1);
    cursor: pointer;
    transition: var(--watchlist-transition, all 0.2s cubic-bezier(0.4, 0, 0.2, 1));
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    outline: none;
    position: relative;
    overflow: hidden;
}

.watchlist-btn:hover {
    background: var(--watchlist-primary-weak, rgba(56, 189, 248, 0.1));
    color: var(--watchlist-primary-color, #38bdf8);
    transform: translateY(-1px);
}

.watchlist-btn:active {
    transform: translateY(0);
}

.watchlist-btn-icon {
    font-size: 1.1em;
    line-height: 1;
}

/* Active State */
.watchlist-btn.active {
    background: linear-gradient(135deg, rgba(var(--watchlist-primary-rgb, 56, 189, 248), 0.2) 0%, rgba(34, 211, 238, 0.15) 100%);
    color: var(--watchlist-primary-color, #38bdf8);
    border-color: rgba(var(--watchlist-primary-rgb, 56, 189, 248), 0.4);
    box-shadow: 0 4px 12px rgba(var(--watchlist-primary-rgb, 56, 189, 248), 0.15);
}

/* Specific Status Colors (Optional overrides for active state) */
.watchlist-btn[data-list-id="1"].active {
    /* Просмотрено - Green */
    color: var(--watchlist-success, #34d399);
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.4);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.15);
}

.watchlist-btn[data-list-id="3"].active {
    /* Запланировано - Warning/Orange */
    color: var(--watchlist-warning, #fbbf24);
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15);
}

.watchlist-btn[data-list-id="5"].active {
    /* Брошено - Red */
    color: var(--watchlist-danger, #f87171);
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.4);
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.15);
}

/* Loading State */
.watchlist-btn--loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}

/* Pulse Animation */
@keyframes wl-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.watchlist-btn--pulse {
    animation: wl-pulse 0.3s ease-in-out;
}

/* Toast Notifications - Matching Theme */
.watchlist-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    background: #111a2f;
    /* --color-surface */
    color: #e2e8f0;
    /* --color-text */
    border-radius: 12px;
    /* --radius-md */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    font-family: inherit;
}

.watchlist-toast--visible {
    transform: translateY(0);
    opacity: 1;
}

.watchlist-toast--success {
    border-left: 4px solid #34d399;
    /* --color-success */
}

.watchlist-toast--error {
    border-left: 4px solid #f87171;
    /* --color-danger */
}

.watchlist-toast__icon {
    font-size: 1.2rem;
    line-height: 1;
}

.watchlist-toast__icon::before {
    font-family: FontAwesome, 'Font Awesome 5 Free', sans-serif;
    font-weight: normal;
}

.watchlist-toast--success .watchlist-toast__icon::before {
    content: "\f00c";
    color: var(--watchlist-success, #34d399);
}

.watchlist-toast--error .watchlist-toast__icon::before {
    content: "\f071";
    color: var(--watchlist-warning, #fbbf24);
}

.watchlist-toast__content {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
    .watchlist-controls {
        width: 100%;
        padding: 8px;
        gap: 8px;
    }

    .watchlist-btn {
        flex: 1 1 auto;
        justify-content: center;
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* WatchList Premium CSS - LordSerial Modern Integration */

    /* Widget Container */
    .watchlist-widget {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 24px;
        /* Matches --gap */
        width: 100%;
        animation: fadeIn 0.5s ease;
    }

    .watchlist-controls {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        background: rgba(17, 26, 47, 0.6);
        /* Slightly transparent surface */
        padding: 10px 16px;
        border-radius: 16px;
        /* Matches --radius-lg approx */
        border: 1px solid rgba(148, 163, 184, 0.15);
        /* Subtle border */
        backdrop-filter: blur(8px);
    }

    /* Buttons */
    .watchlist-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 18px;
        background: transparent;
        border: 1px solid transparent;
        border-radius: 10px;
        /* Matches --radius-md approx */
        color: #cbd5e1;
        /* --color-muted */
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        font-size: 0.9rem;
        font-weight: 600;
        font-family: inherit;
        outline: none;
        position: relative;
        overflow: hidden;
    }

    .watchlist-btn:hover {
        background: rgba(56, 189, 248, 0.1);
        /* --color-primary-weak */
        color: #38bdf8;
        /* --color-primary */
        transform: translateY(-1px);
    }

    .watchlist-btn:active {
        transform: translateY(0);
    }

    .watchlist-btn-icon {
        font-size: 1.1em;
        line-height: 1;
    }

    /* Active State */
    .watchlist-btn.active {
        background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(34, 211, 238, 0.15) 100%);
        color: #38bdf8;
        /* --color-primary */
        border-color: rgba(56, 189, 248, 0.4);
        box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
    }

    /* Specific Status Colors (Optional overrides for active state) */
    .watchlist-btn[data-list-id="1"].active {
        /* Просмотрено - Green */
        color: #34d399;
        /* --color-success */
        background: rgba(52, 211, 153, 0.15);
        border-color: rgba(52, 211, 153, 0.4);
        box-shadow: 0 4px 12px rgba(52, 211, 153, 0.15);
    }

    .watchlist-btn[data-list-id="3"].active {
        /* Запланировано - Warning/Orange */
        color: #fbbf24;
        /* --color-warning */
        background: rgba(251, 191, 36, 0.15);
        border-color: rgba(251, 191, 36, 0.4);
        box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15);
    }

    .watchlist-btn[data-list-id="5"].active {
        /* Брошено - Red */
        color: #f87171;
        /* --color-danger */
        background: rgba(248, 113, 113, 0.15);
        border-color: rgba(248, 113, 113, 0.4);
        box-shadow: 0 4px 12px rgba(248, 113, 113, 0.15);
    }

    /* Loading State */
    .watchlist-btn--loading {
        opacity: 0.7;
        pointer-events: none;
        cursor: wait;
    }

    /* Pulse Animation */
    @keyframes wl-pulse {
        0% {
            transform: scale(1);
        }

        50% {
            transform: scale(1.05);
        }

        100% {
            transform: scale(1);
        }
    }

    .watchlist-btn--pulse {
        animation: wl-pulse 0.3s ease-in-out;
    }

    /* Toast Notifications - Matching Theme */
    .watchlist-toast {
        position: fixed;
        bottom: 30px;
        right: 30px;
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 16px 24px;
        background: #111a2f;
        /* --color-surface */
        color: #e2e8f0;
        /* --color-text */
        border-radius: 12px;
        /* --radius-md */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(148, 163, 184, 0.2);
        transform: translateY(100px);
        opacity: 0;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9999;
        font-family: inherit;
    }

    .watchlist-toast--visible {
        transform: translateY(0);
        opacity: 1;
    }

    .watchlist-toast--success {
        border-left: 4px solid #34d399;
        /* --color-success */
    }

    .watchlist-toast--error {
        border-left: 4px solid #f87171;
        /* --color-danger */
    }

    .watchlist-toast__icon {
        font-size: 1.2rem;
    }

    .watchlist-toast__content {
        font-size: 0.95rem;
        font-weight: 500;
    }

    /* Responsive */
    @media (max-width: 600px) {
        .watchlist-controls {
            width: 100%;
            padding: 8px;
            gap: 8px;
        }

        .watchlist-btn {
            flex: 1 1 auto;
            justify-content: center;
            padding: 10px 12px;
            font-size: 0.85rem;
        }

        .watchlist-btn-text {
            display: none;
            /* Hide text on very small screens if needed, or keep it */
        }

        /* Show text only for active or if enough space. Let's keep text for now but make it smaller */
        .watchlist-btn-text {
            display: inline-block;
        }
    }

    /* Profile Widget */
    .watchlist-profile {
        margin-top: 24px;
        padding-top: 24px;
        border-top: 1px solid rgba(148, 163, 184, 0.2);
    }

    .watchlist-profile__title {
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 16px;
        color: #e2e8f0;
    }

    .watchlist-profile__grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }

    .watchlist-profile__item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px;
        background: rgba(17, 26, 47, 0.6);
        border: 1px solid rgba(148, 163, 184, 0.15);
        border-radius: 12px;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .watchlist-profile__item:hover {
        background: rgba(56, 189, 248, 0.1);
        border-color: rgba(56, 189, 248, 0.3);
        transform: translateY(-2px);
    }

    .watchlist-profile__icon {
        font-size: 1.5rem;
    }

    .watchlist-profile__info {
        display: flex;
        flex-direction: column;
    }

    .watchlist-profile__name {
        font-size: 0.9rem;
        color: #cbd5e1;
        font-weight: 500;
    }

    .watchlist-profile__count {
        font-size: 1.1rem;
        font-weight: 700;
        color: #e2e8f0;
    }

    .watchlist-profile__item:hover .watchlist-profile__count {
        color: #38bdf8;
    }/* Подключается модулем в {headers} — критичные сбросы (lordserials.fan) */

article.full .fplayer-below-player .watchlist-controls {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
}

article.full .fplayer-below-player .watchlist-btn,
article.full .fplayer-below-player button.watchlist-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 62px !important;
    height: auto !important;
    padding: 8px 6px !important;
    border-radius: 7px !important;
    background: #f2f2f2 !important;
    color: #777 !important;
    font-family: 'inter', sans-serif !important;
    text-transform: none !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05) !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
    article.full .fplayer-below-player .watchlist-btn:hover,
    article.full .fplayer-below-player button.watchlist-btn:hover {
        background: #f2f2f2 !important;
        color: #444 !important;
        transform: translateY(-2px);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 9px 18px rgba(0, 0, 0, .18) !important;
    }
}

article.full .fplayer-below-player .watchlist-btn.active,
article.full .fplayer-below-player .watchlist-btn[data-list-id="1"].active,
article.full .fplayer-below-player .watchlist-btn[data-list-id="2"].active,
article.full .fplayer-below-player .watchlist-btn[data-list-id="3"].active,
article.full .fplayer-below-player .watchlist-btn[data-list-id="4"].active,
article.full .fplayer-below-player .watchlist-btn[data-list-id="5"].active {
    background: rgba(121, 193, 66, 0.14) !important;
    color: #79c142 !important;
    border-color: transparent !important;
    box-shadow: inset 0 0 0 1px rgba(121, 193, 66, 0.35) !important;
}

article.full .fplayer-below-player .watchlist-btn-icon {
    display: none !important;
}

article.full .fplayer-below-player .watchlist-btn::before {
    display: block;
    width: 100%;
    text-align: center;
    font-family: FontAwesome, sans-serif !important;
    font-weight: normal !important;
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

article.full .fplayer-below-player .watchlist-btn[data-list-id="1"]::before { content: "\f00c"; }
article.full .fplayer-below-player .watchlist-btn[data-list-id="2"]::before { content: "\f04b"; }
article.full .fplayer-below-player .watchlist-btn[data-list-id="3"]::before { content: "\f017"; }
article.full .fplayer-below-player .watchlist-btn[data-list-id="4"]::before { content: "\f04c"; }
article.full .fplayer-below-player .watchlist-btn[data-list-id="5"]::before { content: "\f05e"; }

article.full .fplayer-below-player .watchlist-toast__icon::before {
    font-family: FontAwesome, sans-serif !important;
    font-weight: normal !important;
}

.fleft-img .CallendarButtons:not(.poster-actions) button.watchlist-popover__trigger:not(:has(.serial-side-btn__core)) {
    display: grid !important;
    width: 100% !important;
    min-height: 42px !important;
    padding: 0 !important;
    text-transform: none !important;
    background: #fff !important;
    border: 1px solid #dde3e8 !important;
    color: #2b333c !important;
    box-shadow: 0 4px 12px rgba(20, 28, 36, .04) !important;
}

.fleft-img .CallendarButtons:not(.poster-actions) button.watchlist-popover__trigger:hover,
.fleft-img .CallendarButtons:not(.poster-actions) button.watchlist-popover__trigger:focus {
    background: #fff !important;
    color: #2b333c !important;
    border-color: #cfd8df !important;
    box-shadow: 0 8px 18px rgba(20, 28, 36, .08) !important;
}

.fleft-img .CallendarButtons:not(.poster-actions) .serial-side-btn__ico {
    background: #f3f5f7 !important;
    color: #7a838d !important;
    border-right: 1px solid #dde3e8 !important;
}

.fleft-img .CallendarButtons:not(.poster-actions) .serial-side-btn__arrow {
    background: #fafbfc !important;
    color: #4d5964 !important;
    border-left: 1px solid #dde3e8 !important;
}
