/**
 * WG Comments - Advanced Features Styles
 * Spoiler, YouTube, Polls, Mentions
 *
 * @package WG_Comments
 * @version 1.0.0
 */

/* ===========================
   Spoiler
   =========================== */

.wgc-spoiler {
    background: #000000;
    color: transparent;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
}

.wgc-spoiler::before {
    content: '';
    display: none;
}

.wgc-spoiler.revealed,
.wgc-spoiler:hover {
    background: transparent;
    color: inherit;
}

.wgc-spoiler.revealed::before,
.wgc-spoiler:hover::before {
    display: none;
}

/* Spoiler Button in Toolbar */
#wgc-spoiler-btn {
    background: transparent !important;
    border: 1px solid #6b7280 !important;
    color: #9ca3af !important;
    opacity: 1 !important;
}

#wgc-spoiler-btn:hover {
    background: rgba(139, 92, 246, 0.1) !important;
    border-color: #8b5cf6 !important;
    color: #8b5cf6 !important;
    transform: scale(1.05);
}

#wgc-spoiler-btn svg {
    stroke: currentColor !important;
}

/* ===========================
   YouTube Embeds
   =========================== */

.wgc-youtube-embed {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #000000;
}

.wgc-youtube-embed::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.wgc-youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===========================
   Mentions (@Username)
   =========================== */

.wgc-mention {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: #ffffff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wgc-mention:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* Mention Dropdown */
.wgc-mention-dropdown {
    position: absolute;
    z-index: 10000;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    max-width: 300px;
    max-height: 200px;
    overflow-y: auto;
}

.wgc-mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wgc-mention-item:hover {
    background: #f8f9fa;
}

.wgc-mention-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.wgc-mention-name {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
}

/* ===========================
   Polls
   =========================== */

.wgc-poll {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}

.wgc-poll-question {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    color: #212529;
}

.wgc-poll-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.wgc-poll-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wgc-poll-option:hover {
    border-color: #8b5cf6;
    background: #f3f0ff;
}

.wgc-poll-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.wgc-poll-option label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
}

.wgc-poll-submit {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wgc-poll-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Poll Results */
.wgc-poll-results {
    margin-top: 16px;
}

.wgc-poll-result-item {
    margin-bottom: 12px;
}

.wgc-poll-result-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 13px;
    color: #495057;
}

.wgc-poll-result-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.wgc-poll-result-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6 0%, #6366f1 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ===========================
   Favorite Emojis Tab
   =========================== */

.wgc-emoji-tab[data-category="favorites"]::before {
    content: '⭐ ';
}

.wgc-emoji-favorites-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 13px;
}

/* ===========================
   Poll Button
   =========================== */

#wgc-poll-btn {
    font-size: 16px;
}

#wgc-poll-btn:hover {
    transform: scale(1.1);
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 768px) {
    .wgc-youtube-embed {
        margin: 12px 0;
    }

    .wgc-poll {
        padding: 16px;
    }

    .wgc-mention-dropdown {
        max-width: calc(100vw - 40px);
    }

    .wgc-spoiler::before {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .wgc-poll-option {
        padding: 10px;
    }

    .wgc-poll-question {
        font-size: 14px;
    }

    .wgc-youtube-embed {
        max-width: 100%;
    }
}

/* ===========================
   Loading States
   =========================== */

.wgc-poll.loading {
    opacity: 0.6;
    pointer-events: none;
}

.wgc-poll.voted .wgc-poll-options {
    pointer-events: none;
}

.wgc-poll.voted .wgc-poll-submit {
    display: none;
}

/* ===========================
   Animations
   =========================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wgc-mention-dropdown {
    animation: fadeIn 0.2s ease;
}

.wgc-poll-result-fill {
    animation: fillBar 0.5s ease;
}

@keyframes fillBar {
    from {
        width: 0;
    }
}

/* ===========================
   Email Notification Checkbox
   =========================== */

.wgc-notification-wrapper {
    margin: 0;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0;
}

.wgc-notification-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.wgc-notification-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #8b5cf6;
}

.wgc-notification-label:hover {
    color: #212529;
}

/* ===========================
   Lists in Comments - Fix
   =========================== */

.wgc-comment-content ol,
.wgc-comment-content ul,
.ql-editor ol,
.ql-editor ul {
    padding-left: 1.5em;
    margin: 12px 0;
}

.wgc-comment-content ol li,
.ql-editor ol li {
    list-style-type: decimal;
    margin: 4px 0;
}

.wgc-comment-content ul li,
.ql-editor ul li {
    list-style-type: disc;
    margin: 4px 0;
}

/* Nested lists */
.wgc-comment-content ol ol,
.wgc-comment-content ul ul,
.ql-editor ol ol,
.ql-editor ul ul {
    margin: 4px 0;
}

/* ===========================
   Accessibility
   =========================== */

.wgc-spoiler:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.wgc-poll-option:focus-within {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.wgc-mention:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}
