/* Movidna Comments Styles (Glassmorphism) */

/* Container */
.movidna-comments-area {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    height: auto;
    display: flex;
    flex-direction: column;
}

.comments-header h2 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Single Comment Card */
.movidna-comment-card {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    transition: background 0.3s;
    border-radius: 6px;
    height: auto;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.movidna-comment-card:hover {
    background: rgba(255, 255, 255, 0.02);
}

.movidna-comment-card.is-reply {
    margin-left: 30px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Avatar */
.comment-avatar img {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    object-fit: cover;
    border: 2px solid #e50914;
    flex-shrink: 0;
}

/* Body */
.comment-body {
    flex: 1;
    min-width: 0;
    /* Flexbox text overflow fix */
    display: flex;
    flex-direction: column;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 6px;
}

.author-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.author-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.comment-date {
    color: #888;
    font-size: 0.8rem;
}

.edited-badge {
    font-size: 0.7rem;
    color: #aaa;
    font-style: italic;
}

.spoiler-badge {
    background: #e50914;
    color: #fff;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Actions */
.comment-actions {
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    gap: 4px;
}

.movidna-comment-card:hover .comment-actions {
    opacity: 1;
}

.action-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.action-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.action-btn.delete-btn:hover {
    color: #ff4444;
}

/* Content */
.comment-content-wrapper {
    position: relative;
    padding: 2px 0;
    width: 100%;
}

.comment-content {
    color: #ddd;
    font-size: 0.9rem;
    line-height: 1.3;
    word-wrap: break-word !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    width: 100%;
    max-width: 100%;
}

.comment-content p {
    margin: 0 0 2px 0;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

/* Spoiler Blur Effect */
.movidna-comment-card.is-spoiler .comment-content,
.spoiler-blur .comment-content {
    filter: blur(8px);
    opacity: 0.3;
    user-select: none;
    pointer-events: none;
}

.spoiler-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: none;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 2;
}

.movidna-comment-card.is-spoiler .spoiler-overlay,
.spoiler-blur .spoiler-overlay {
    display: flex;
}

.comment-content-wrapper:not(.spoiler-blur) {
    cursor: auto;
}

/* Footer / Reply */
.comment-footer {
    margin-top: 2px;
}

.comment-reply-link {
    color: #e50914;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.comment-reply-link:hover {
    text-decoration: underline;
}

/* Form Styles */
.movidna-comment-form-wrapper {
    margin-top: 0;
    margin-bottom: 20px;
    background: rgba(22, 22, 22, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    /* Matches card radius */
    padding: 15px;
    /* Reduced for compactness */
}

.movidna-respond h3 {
    margin-bottom: 15px;
    color: #fff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #ccc;
    font-size: 0.85rem;
}

.user-info img {
    border-radius: 50%;
}

#comment-textarea,
.edit-textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* Fixes overflow issues */
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    color: #fff;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.95rem;
    margin-bottom: 10px;
    resize: vertical;
    transition: border-color 0.3s;
    font-family: inherit;
}

#comment-textarea:focus,
.edit-textarea:focus {
    border-color: #e50914;
    outline: none;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Spoiler Toggle Switch */
.spoiler-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #ccc;
    font-size: 0.9rem;
}

.spoiler-toggle input {
    display: none;
}

.slider {
    width: 40px;
    height: 20px;
    position: relative;
    background-color: #555;
    transition: .4s;
    border-radius: 34px;
    display: inline-block;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #e50914;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Submit Button */
.submit-btn,
.btn-save {
    background: #e50914;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.submit-btn:hover,
.btn-save:hover {
    background: #b20710;
}

.btn-cancel {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-cancel:hover {
    border-color: #999;
}

/* Edit Form */
.edit-form-wrapper {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
}

.edit-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Login Prompt */
.login-prompt {
    text-align: center;
    padding: 20px;
    background: rgba(229, 9, 20, 0.1);
    border: 1px solid rgba(229, 9, 20, 0.3);
    border-radius: 8px;
}

.login-prompt a {
    color: #e50914;
    font-weight: bold;
    text-decoration: none;
}

.no-comments {
    text-align: center;
    color: #888;
    padding: 20px;
}