/* ==========================================
   COMMENT SHEET STYLES - ENHANCED
   ========================================== */

.comment-sheet {
    position: fixed;
    right: -500px;
    top: 0;
    width: 500px;
    height: 100vh;
    background-color: #1a1a1a;
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    z-index: 999;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.5);
}

.comment-sheet.open {
    right: 0;
}

.comment-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.comment-sheet-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #2a2a2a;
    border: 1px solid #333;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background-color: #333;
    border-color: #444;
    transform: rotate(90deg);
}

.comment-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
}

/* Loading State */
.loading-comments,
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #999;
    text-align: center;
}

.loading-comments .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

.error-message i {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

/* No Comments State */
.no-comments-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    width: 100%;
}

.no-comments-container i {
    font-size: 4rem;
    color: #444;
    margin-bottom: 1rem;
}

.no-comments-text {
    font-size: 1.125rem;
    color: #fff;
    margin-bottom: 0.5rem;
    display: block;
}

.no-comments-subtext {
    font-size: 0.875rem;
    color: #999;
    margin: 0;
}

/* Comment Item */
.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background-color: #2a2a2a;
    transition: all 0.3s ease;
    position: relative;
}

.comment-item:hover {
    background-color: #333;
}

.comment-item.pinned {
    background-color: #2d2520;
    border: 1px solid #ff6b3533;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: #fff;
    text-transform: uppercase;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.comment-user {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.pin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    background-color: #ff6b3522;
    color: #ff6b35;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.pin-badge i {
    font-size: 0.625rem;
}

.comment-text {
    font-size: 0.875rem;
    color: #ccc;
    margin: 0 0 0.5rem 0;
    word-wrap: break-word;
    line-height: 1.5;
    white-space: pre-wrap;
}

.comment-text.editing {
    white-space: normal;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: #999;
}

.comment-time {
    cursor: default;
}

.comment-like-btn,
.comment-reply-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.comment-like-btn:hover,
.comment-reply-btn:hover {
    color: #ff6b35;
}

.comment-like-btn.liked {
    color: #ff6b35;
}

.comment-like-btn .like-count {
    font-weight: 600;
}

/* Comment Actions Menu */
.comment-actions-menu {
    position: relative;
}


.hide-comment-button{
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.comment-menu-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.comment-menu-btn:hover {
    background-color: #444;
    color: #fff;
}

.comment-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 150px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.comment-dropdown.show {
    display: block;
}

.comment-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: #ccc;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.comment-dropdown .dropdown-item:hover {
    background-color: #333;
    color: #fff;
}

.comment-dropdown .dropdown-item.text-danger {
    color: #dc3545;
}

.comment-dropdown .dropdown-item.text-danger:hover {
    background-color: #dc354522;
}

/* Edit Input */
.edit-input-container {
    margin-top: 0.5rem;
}

.edit-input {
    width: 100%;
    padding: 0.75rem;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.edit-input:focus {
    outline: none;
    border-color: #ff6b35;
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-cancel,
.btn-save {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel {
    background-color: #444;
    color: #ccc;
}

.btn-cancel:hover {
    background-color: #555;
}

.btn-save {
    background: linear-gradient(90deg, #ff6b35 0%, #f7931e 100%);
    color: #fff;
}

.btn-save:hover {
    transform: scale(1.05);
}

/* Reply Input */
.reply-input-container {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #222;
    border-radius: 0.5rem;
}

.reply-input {
    width: 100%;
    padding: 0.625rem;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 0.375rem;
    color: #fff;
    font-size: 0.875rem;
}

.reply-input:focus {
    outline: none;
    border-color: #ff6b35;
}

.reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-send {
    padding: 0.5rem 1rem;
    background: linear-gradient(90deg, #ff6b35 0%, #f7931e 100%);
    border: none;
    border-radius: 0.375rem;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-send:hover {
    transform: scale(1.05);
}

/* Replies Container */
.replies-container {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #444;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reply-item {
    display: flex;
    gap: 0.75rem;
}

.reply-item .comment-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.reply-item .comment-user {
    font-size: 0.875rem;
}

.reply-item .comment-text {
    font-size: 0.8125rem;
}

/* Comment Sheet Footer */
.comment-sheet-footer {
    display: flex;
    /* gap: 0.75rem; */
    padding: 1.5rem;
    border-top: 1px solid #333;
    background-color: #222;
    flex-shrink: 0;
    justify-content: center;
}

.comment-sheet-footer input {
    flex: 1;
    /* padding: 0.75rem 1rem; */
    border: 1px solid #333;
    border-radius: 0.5rem;
    background-color: #2a2a2a;
    color: #fff;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.comment-sheet-footer input:focus {
    outline: none;
    border-color: #ff6b35;
    background-color: #333;
}

.comment-sheet-footer button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-dark);
    border: none;
    border-radius: 1.5rem;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.comment-sheet-footer button:hover {
    background: #fff !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.comment-sheet-footer button:active {
    transform: scale(0.98);
}

/* Scrollbar styling */
.comment-sheet-body::-webkit-scrollbar {
    width: 6px;
}

.comment-sheet-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.comment-sheet-body::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.comment-sheet-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .comment-sheet {
        width: 100%;
        right: -100%;
        height: 100%;
    }

    .comment-sheet.open {
        right: 0;
    }

    .comment-item {
        padding: 0.75rem;
    }

    .replies-container {
        padding-left: 0.5rem;
    }
    .comment-sheet-footer{
        padding: 1rem;
    }
    .comment-sheet-footer input{
        width: 90%;
    }
}

@media (max-width:425px){
    .comment-sheet-footer button { padding: 0.75rem  0.75rem; font-size: 13px;}
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.comment-item,
.reply-item {
    animation: fadeIn 0.3s ease-out;
}

/* Modal Background Blur */
#guidelinesModal .modal-content {
    background-color: #000;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    box-shadow: 1px 0px 14px 0px #494646;
    color: #fff;
    padding: 20px;
}

/* Title */
#guidelinesModal h5 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Description */
#guidelinesModal p {
    font-size: 14px;
    line-height: 1.6;
    color: #d1d5db;
}

/* Checkbox Style */
#guidelinesModal input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #f97316; /* orange */
    cursor: pointer;
}

/* Label */
#guidelinesModal label {
    font-size: 14px;
    color: #e5e7eb;
    cursor: pointer;
}

/* Continue Button */
#guidelinesModal .btn-primary {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 500;
    margin-top: 18px;

    background: linear-gradient(90deg, #dc7228 50%, #000 100%);
    color: #fff;

    transition: all 0.3s ease;
}

/* Button Hover */
#guidelinesModal .btn-primary:hover {
    background: linear-gradient(90deg, #ea580c, #451a03);
    transform: translateY(-1px);
}

/* Optional Glow */
#guidelinesModal .btn-primary:active {
    transform: scale(0.98);
}

/* ===== Staged attachment preview (before sending) ===== */
.attachment-preview {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

.attachment-preview-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.attachment-preview-item img,
.attachment-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attachment-preview-item .attachment-file-name {
    /* keep the accessible name but don't show it visually in the small thumb */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

.attachment-remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.65);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.attachment-remove-btn:hover {
    background: #dc2626;
}

/* ===== Rendered attachments inside a posted comment ===== */
.comment-media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    max-width: 320px;
    margin-bottom: 5px;
}

.comment-media-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,0.2);
}

.comment-media-link {
    display: block;
    width: 100%;
    height: 100%;
}

.comment-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: rgba(0,0,0,0.2);
}

video.comment-media {
    background: #000;
}

.comment-media-expand {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s ease;
}

.comment-media-expand:hover {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
}

/* ===== Send button spinner state ===== */
.comment-sheet-footer button#sendBtn-uploading,
.comment-sheet-footer button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.edit-footer {
    align-items: center;
    gap: 0.5rem;
}

.edit-footer .edit-input {
    flex: 1 1 0%;   /* was implicitly flex-basis: 100% via width:100% */
    width: auto;
    min-width: 0;   /* allow shrinking below content size when space is tight */
}

.edit-footer button {
    flex: 0 0 auto;  /* keep attach/cancel/save at their natural size */
}


.edit-comment{
    display: flex;
    border-top: 1px solid #333;
    background-color: #222;
    flex-shrink: 0;
    justify-content: center;
}

.edit-comment button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-dark);
    border: none;
    border-radius: 0.5rem;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.edit-comment button:hover{
   background-color: #fff;
}

.comment-media-wrap { cursor: pointer; position: relative; }

.comment-media-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    pointer-events: none;
}

.media-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}
.media-lightbox.open { display: block; }

.media-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.media-lightbox-inner {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
    border-radius: 6px;
}

.media-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
}

.media-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
}
.media-lightbox-prev { left: 20px; }
.media-lightbox-next { right: 20px; }

.media-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0,0,0,0.5);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 2;
}


.comment-sheet-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
}

.comment-input-pill {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1e1e1e; /* dark pill background, matches screenshot */
    border: 1px solid rgba(220, 114, 40, 0.4); /* subtle orange border like the screenshot */
    border-radius: 999px;
    padding: 6px 14px;
    color: #dc7228;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* .icon-btn {
    background: none;
    border: none;
    color: #fff;
    border-radius: 999px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
} */

.comment-input-pill input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 14px;
}

.comment-input-pill input[type="text"]::placeholder {
    color: #8a8a8a;
}