/* Spoiler Styles for Comments */

/* 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;
}

.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);
}

/* 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 in comments */
.spoiler-toggle {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    margin: 5px 0;
    display: inline-block;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.spoiler-toggle:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d63031 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    text-decoration: none;
    color: white;
}

.spoiler-toggle.spoiler-active {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
}

.spoiler-toggle.spoiler-active:hover {
    background: linear-gradient(135deg, #00a085 0%, #019376 100%);
}

/* Spoiler content container */
.spoiler-container {
    margin: 10px 0;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 8px;
    background: linear-gradient(135deg, #ffeef8 0%, #f8f9ff 100%);
    direction: rtl;
    text-align: right;
}

.dark .spoiler-container {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a1a2e 100%);
    border-color: #6b7280;
}

/* Spoiler content - hidden by default */
.spoiler-content {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    padding: 12px;
    margin-top: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-10px);
    direction: rtl;
    text-align: right;
}

.dark .spoiler-content {
    background: rgba(75, 85, 99, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

/* Spoiler content - visible state */
.spoiler-content.spoiler-visible {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
}

/* Warning icon for spoilers */
.spoiler-warning {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #f59e0b;
    font-size: 12px;
    margin-bottom: 5px;
    font-weight: 600;
}

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

.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;
}