/**
 * Chapter Unlock Overlay Styles
 * Consistent with the dark theme used in YupManga reader.
 *
 * @package YupManga
 * @since   0.0.2.0
 */

/* ======================== */
/* OVERLAY BACKDROP          */
/* ======================== */
.chapter-unlock-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.chapter-unlock-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ======================== */
/* CONTAINER / CARD          */
/* ======================== */
.chapter-unlock-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    animation: chapterUnlockSlideIn 0.35s ease;
}

.chapter-unlock-card {
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 16px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(168, 85, 247, 0.12);
    overflow: hidden;
}

@keyframes chapterUnlockSlideIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ======================== */
/* HEADER                    */
/* ======================== */
.chapter-unlock-header {
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.08) 0%, transparent 100%);
}

.chapter-unlock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    margin-bottom: 12px;
}

.chapter-unlock-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.chapter-unlock-subtitle {
    font-size: 14px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.4;
}

/* ======================== */
/* BODY                      */
/* ======================== */
.chapter-unlock-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Info Box (guest state) */
.chapter-unlock-info-box {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.15);
    color: #d1d5db;
    font-size: 14px;
    line-height: 1.5;
}

.chapter-unlock-info-box svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #a855f7;
}

/* ======================== */
/* AD AREA                   */
/* ======================== */
.chapter-unlock-ad-area {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.3);
}

.chapter-unlock-ad-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.chapter-unlock-ad-content {
    padding: 12px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ======================== */
/* TIMER                     */
/* ======================== */
.chapter-unlock-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.chapter-unlock-timer-circle {
    position: relative;
    width: 80px;
    height: 80px;
}

.chapter-unlock-timer-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.chapter-unlock-timer-circle .timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 4;
}

.chapter-unlock-timer-circle .timer-progress {
    fill: none;
    stroke: #a855f7;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.chapter-unlock-timer-circle .timer-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.chapter-unlock-timer-label {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* ======================== */
/* BUTTONS                   */
/* ======================== */
.chapter-unlock-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-unlock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.chapter-unlock-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary - Purple gradient */
.chapter-unlock-btn-primary {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.3);
}

.chapter-unlock-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #b97cf7 0%, #8b5cf6 100%);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    transform: translateY(-1px);
}

/* Accent - Amber/Gold for points */
.chapter-unlock-btn-accent {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.chapter-unlock-btn-accent:hover:not(:disabled) {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

/* Secondary - Subtle */
.chapter-unlock-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #d1d5db;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chapter-unlock-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.chapter-unlock-btn-small {
    padding: 8px 12px;
    font-size: 13px;
}

/* ======================== */
/* DIVIDER                   */
/* ======================== */
.chapter-unlock-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chapter-unlock-divider::before,
.chapter-unlock-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* ======================== */
/* POINTS SECTION            */
/* ======================== */
.chapter-unlock-points-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-unlock-points-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chapter-unlock-points-cost {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #fbbf24;
}

.chapter-unlock-points-cost svg {
    color: #f59e0b;
}

.chapter-unlock-points-balance {
    font-size: 12px;
    color: #6b7280;
    padding-left: 26px;
}

.chapter-unlock-insufficient {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    font-size: 13px;
    line-height: 1.4;
}

.chapter-unlock-insufficient svg {
    flex-shrink: 0;
    color: #ef4444;
}

/* ======================== */
/* RESPONSIVE                */
/* ======================== */
@media (max-width: 480px) {
    .chapter-unlock-container {
        max-width: 100%;
    }

    .chapter-unlock-header {
        padding: 20px 16px 14px;
    }

    .chapter-unlock-body {
        padding: 16px;
    }

    .chapter-unlock-title {
        font-size: 18px;
    }

    .chapter-unlock-icon {
        width: 48px;
        height: 48px;
    }

    .chapter-unlock-icon svg {
        width: 24px;
        height: 24px;
    }
}
