/* Spoiler Styles for Comments */

/* ============================================
   Comment Form Styling
   ============================================ */

/* Comment Form Title */
.comment-reply-title {
    font-size: 22px;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 24px;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 12px;
    border-top: none !important;
    border-bottom: 2px solid rgba(254, 119, 67, 0.4);
    direction: rtl;
}

.comment-reply-title::before {
    display: none !important;
}

#respond {
    border-top: none !important;
    padding-top: 0 !important;
}

#respond::before {
    display: none !important;
}

/* Comment Form Container */
.comment-form-wrapper {
    margin-bottom: 20px;
}

/* ============================================
   Comment Actions (Like & Reply) Mobile Fix
   ============================================ */

/* Comment container layout fix for mobile */
@media (max-width: 768px) {
    /* Reset comment layout */
    li.comment {
        position: relative !important;
        padding-bottom: 50px !important;
    }
    
    /* Target the main flex container */
    li.comment > div.flex.items-center.justify-between {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    /* Move action buttons container to bottom-left */
    li.comment > div.flex.items-center.justify-between > div.flex.flex-col {
        position: absolute !important;
        bottom: 10px !important;
        left: 10px !important;
        right: auto !important;
        top: auto !important;
        flex-direction: row !important;
        gap: 8px !important;
        align-items: center !important;
        justify-content: flex-start !important;
        background: rgba(0, 0, 0, 0.1) !important;
        padding: 6px 10px !important;
        border-radius: 8px !important;
        backdrop-filter: blur(4px) !important;
        z-index: 10 !important;
    }
    
    /* Make buttons smaller */
    li.comment .wpulike {
        transform: scale(0.7) !important;
        transform-origin: left center !important;
    }
    
    li.comment .comment-reply-link {
        font-size: 11px !important;
        padding: 4px 8px !important;
        background: rgba(254, 119, 67, 0.8) !important;
        color: white !important;
        border-radius: 4px !important;
        text-decoration: none !important;
    }
    
    /* Hide any flex containers that might interfere */
    li.comment > div.flex.items-center.justify-between > div.flex.items-center {
        display: none !important;
    }
}

/* Textarea Styling */
.comment-textarea {
    width: 100% !important;
    padding: 16px !important;
    border: 2px solid rgba(254, 119, 67, 0.2) !important;
    border-radius: 12px !important;
    background: rgba(31, 41, 55, 0.5) !important;
    color: #e5e7eb !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    resize: vertical !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    direction: rtl !important;
    font-family: inherit !important;
}

.comment-textarea:focus {
    outline: none !important;
    border-color: #FE7743 !important;
    background: rgba(31, 41, 55, 0.7) !important;
    box-shadow: 0 0 0 3px rgba(254, 119, 67, 0.15) !important;
}

.comment-textarea::placeholder {
    color: rgba(156, 163, 175, 0.7);
}

/* Input Fields Grid */
.comment-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
    direction: rtl;
}

@media (max-width: 640px) {
    .comment-fields-grid {
        grid-template-columns: 1fr;
    }
}

/* Input Fields */
.comment-input {
    width: 100% !important;
    padding: 14px 16px !important;
    border: 2px solid rgba(254, 119, 67, 0.2) !important;
    border-radius: 10px !important;
    background: rgba(31, 41, 55, 0.5) !important;
    color: #e5e7eb !important;
    font-size: 15px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    direction: rtl !important;
}

.comment-input:focus {
    outline: none !important;
    border-color: #FE7743 !important;
    background: rgba(31, 41, 55, 0.7) !important;
    box-shadow: 0 0 0 3px rgba(254, 119, 67, 0.15) !important;
}

.comment-input::placeholder {
    color: rgba(156, 163, 175, 0.7);
}

/* Checkboxes Container */
.comment-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    direction: rtl;
}

/* Checkbox Label */
.checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    padding: 12px 16px !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
    background: rgba(31, 41, 55, 0.3) !important;
    border: 1px solid rgba(75, 85, 99, 0.3) !important;
    margin-bottom: 8px !important;
}

.checkbox-label:hover {
    background: rgba(31, 41, 55, 0.5) !important;
    border-color: rgba(254, 119, 67, 0.3) !important;
}

.checkbox-label input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    cursor: pointer !important;
    accent-color: #FE7743 !important;
    margin: 0 !important;
}

.checkbox-text {
    color: #d1d5db !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    user-select: none !important;
}

/* Spoiler Checkbox Special Styling */
.spoiler-checkbox {
    border-color: rgba(254, 119, 67, 0.3) !important;
}

.spoiler-checkbox:hover {
    background: rgba(254, 119, 67, 0.08) !important;
    border-color: rgba(254, 119, 67, 0.5) !important;
}

.spoiler-checkbox .checkbox-text {
    color: #FE7743 !important;
}

/* Submit Button */
.comment-submit-btn {
    background: linear-gradient(135deg, #FE7743 0%, #FD5F26 100%) !important;
    color: white !important;
    border: none !important;
    padding: 14px 32px !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 12px rgba(254, 119, 67, 0.3) !important;
    border: 2px solid rgba(254, 119, 67, 0.3) !important;
    width: 100% !important;
    margin-top: 8px !important;
}

.comment-submit-btn:hover {
    background: linear-gradient(135deg, #FD5F26 0%, #FC4709 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(254, 119, 67, 0.4) !important;
}

.comment-submit-btn:active {
    transform: translateY(0) !important;
}

/* Spoiler button in comment form */
.spoiler-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 8px;
    margin-left: 8px;
}

.spoiler-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

/* Full spoiler button */
.full-spoiler-btn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 8px;
    margin-left: 8px;
}

.full-spoiler-btn:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Spoiler help text styling */
.spoiler-help {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
    direction: rtl;
    text-align: right;
    border-left: 3px solid #667eea;
}

.dark .spoiler-help {
    background: #374151;
    color: #d1d5db;
    border-left-color: #8b5cf6;
}

.spoiler-help code {
    background: #e5e7eb;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
    color: #374151;
}

.dark .spoiler-help code {
    background: #4b5563;
    color: #f3f4f6;
}

/* Spoiler toggle button - Clean bottom button */
.spoiler-toggle {
    background: linear-gradient(135deg, rgba(254, 119, 67, 0.9) 0%, rgba(253, 95, 38, 0.9) 100%) !important;
    color: white !important;
    border: none !important;
    padding: 6px 14px !important;
    border-radius: 16px !important;
    cursor: pointer !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    display: inline-block !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(254, 119, 67, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
}

.spoiler-toggle:hover {
    background: linear-gradient(135deg, rgba(253, 95, 38, 0.9) 0%, rgba(252, 71, 9, 0.9) 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(254, 119, 67, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    text-decoration: none !important;
    color: white !important;
}

.spoiler-toggle.spoiler-active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.9) 100%) !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.spoiler-toggle.spoiler-active:hover {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.9) 0%, rgba(4, 120, 87, 0.9) 100%) !important;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

/* Spoiler content container - Minimal Glass Design */
.spoiler-container {
    margin: 8px 0 !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    direction: rtl !important;
    text-align: right !important;
    position: relative !important;
}

.spoiler-container p {
    margin: 0 !important;
    padding: 0 !important;
}

.dark .spoiler-container {
    background: transparent !important;
    border: none !important;
}

/* Spoiler Comment - Blur entire comment */
.spoiler-comment {
    position: relative !important;
}

/* Blur only the content inside spoiler-comment, not the button container */
.spoiler-comment:not(.spoiler-revealed) .spoiler-content {
    filter: blur(8px) !important;
    opacity: 0.6 !important;
    user-select: none !important;
    pointer-events: none !important;
}

.spoiler-comment .spoiler-reveal-btn-container {
    position: static !important;
    transform: none !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 60px !important;
    z-index: 10 !important;
    pointer-events: auto !important;
}

.spoiler-comment .spoiler-reveal-btn-container:not(:first-child) {
    display: none !important;
}

/* When revealed, remove blur from content */
.spoiler-comment.spoiler-revealed .spoiler-content {
    filter: blur(0px) !important;
    opacity: 1 !important;
    user-select: auto !important;
    pointer-events: auto !important;
}

.spoiler-comment.spoiler-revealed {
    filter: blur(0px) !important;
    opacity: 1 !important;
    user-select: auto !important;
    pointer-events: auto !important;
}

/* Spoiler Reveal Button Container */
.spoiler-reveal-btn-container {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10 !important;
    pointer-events: auto !important;
}

/* Glossy Reveal Button */
.spoiler-reveal-btn {
    background: linear-gradient(135deg, 
        rgba(254, 119, 67, 0.95) 0%, 
        rgba(253, 95, 38, 0.95) 50%,
        rgba(252, 71, 9, 0.95) 100%) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50px !important;
    padding: 16px 32px !important;
    color: white !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-shadow: 
        0 8px 32px rgba(254, 119, 67, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    position: relative !important;
    overflow: hidden !important;
}

.spoiler-reveal-btn::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent) !important;
    transition: left 0.8s ease !important;
}

.spoiler-reveal-btn:hover {
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 
        0 12px 40px rgba(254, 119, 67, 0.6),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.spoiler-reveal-btn:hover::before {
    left: 100% !important;
}

.spoiler-reveal-btn:active {
    transform: translateY(-1px) scale(1.02) !important;
    box-shadow: 
        0 6px 20px rgba(254, 119, 67, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
}

.btn-icon {
    font-size: 18px !important;
    animation: pulse 2s infinite !important;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.btn-text {
    direction: rtl !important;
}

/* Hide button when revealed */
.spoiler-comment.spoiler-revealed .spoiler-reveal-btn-container {
    display: none !important;
}

.spoiler-content.spoiler-visible::before {
    display: none !important;
}

/* Warning icon for spoilers - Minimal Glass Badge */
.spoiler-warning {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    color: #FE7743 !important;
    font-size: 11px !important;
    margin: 0 8px 4px 0 !important;
    font-weight: 600 !important;
    background: linear-gradient(135deg, rgba(254, 119, 67, 0.15) 0%, rgba(253, 95, 38, 0.15) 100%) !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    direction: rtl !important;
    border: 1px solid rgba(254, 119, 67, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.spoiler-warning::before {
    content: "⚠️" !important;
    font-size: 12px !important;
}

.dark .spoiler-warning {
    color: #fbbf24;
}

/* Smooth animation for spoiler reveal */
@keyframes spoilerReveal {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.spoiler-content.spoiler-visible {
    animation: spoilerReveal 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .spoiler-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .spoiler-toggle {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .spoiler-content {
        padding: 10px;
    }
    
    .spoiler-help {
        font-size: 11px;
        padding: 6px;
    }
}

/* Focus states for accessibility */
.spoiler-btn:focus,
.spoiler-toggle:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Tooltip styles */
.spoiler-btn[title] {
    position: relative;
}

.spoiler-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.spoiler-btn[title]:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0,0,0,0.8);
    z-index: 1000;
}

/* Comment form container improvements */
#commentform {
    position: relative;
}

/* Improved styling for Persian/Farsi content */
.spoiler-content p {
    line-height: 1.8;
    margin-bottom: 10px;
}

.spoiler-content p:last-child {
    margin-bottom: 0;
}