/* Draggable Bottom Sheet Base Styles */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: var(--font-size-smallest);
    font-weight: 400;
    line-height: 1.3125;
}

.bottom-sheet-overlay.active {
    display: block;
    opacity: 1;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    right: 0;
    width: auto;
    background-color: var(--bg-primary);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    transform: translateY(100%);
    /* transition removed - will be added per breakpoint */
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.bottom-sheet-header {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.bottom-sheet-header h3 {
    margin: 0;
    font-size: var(--font-sm);
    font-weight: 400;
    color: var(--text-primary);
    font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    line-height: 1.3125;
}

.btn-close {
    background: none;
    border: none;
    font-size: var(--font-size-medium);
    cursor: pointer;
    font-size: var(--font-size-medium);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    opacity: 0.7;
    font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.3125;
}

.btn-close:hover {
    opacity: 1;
}

.bottom-sheet-handle .handle-two {
    width: 40px;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    cursor: grab;
    display: flex;
}

.bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    color: var(--text-primary);
    font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: var(--font-size-smallest);
    font-weight: 400;
    line-height: 1.3125;
}

.bottom-sheet-content-two {
    padding: 15px 0 15px 0px;
}

.comment-input-container {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
    align-items: center;
}

.comment-input-wrapper {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
    align-items: center;
}

.comment-user-profile {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.comment-input-container:not(.focused) .comment-user-profile {
    display: block;
}

.comment-input-container.focused .comment-user-profile {
    display: none;
}

.comment-input-container:not(.focused) .btn-submit-comment {
    display: none;
}

.comment-input-container.focused .btn-submit-comment {
    display: flex;
}

.comment-input-container input {
    flex: 1;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: var(--font-xs);
    line-height: 1.3125;
}

.comment-input-container input:focus {
    outline: none;
    opacity: 0.9;
}

.btn-submit-comment {
    background-color: var(--text-primary);
    border: none;
    border-radius: 50%;
    display: none;
    /* Hidden by default, shown only when focused */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 7px;
}

.btn-submit-comment:hover {
    opacity: 0.9;
}

.btn-submit-comment svg {
    width: 20px;
    height: 20px;
    fill: var(--bg-primary);
}

/* Comment Content Styles */
.comment-content {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0 0 0;
}

.comment-content:last-child {
    border-bottom: none;
}



/* Comment Header Styles */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.comment-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.comment-user-details {
    display: flex;
    flex-direction: column;
}

.comment-author {
    color: var(--text-secondary);
    font-size: var(--font-xs);
    line-height: 1.3;
}

.comment-time {
    line-height: 1.3;
    color: var(--text-muted);
    font-size: var(--font-size-tiny);
}

.comment-menu {
    flex-shrink: 0;
    position: relative;
}

.comment-menu-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-secondary);
    border-radius: 50px;
    position: relative;
}

.comment-menu-button:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Comment dropdown menu */
.comment-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 5px;
    background: var(--bg-primary);
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    width: 160px;
    z-index: 1000;
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-in-out;
    overflow: hidden;
}

.comment-dropdown.show {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.comment-dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    font-size: var(--font-xs);
    color: var(--text-secondary);
    transition: background-color 0.2s;
    font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.3125;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.comment-dropdown-item:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.comment-dropdown-item.delete {
    color: #ff4d4d;
}

.comment-dropdown-item.delete:hover {
    background-color: var(--bg-secondary);
    color: #ff0000;
}

.comment-dropdown-icon {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    flex-shrink: 0;
}

.comment-text-content {
    margin-bottom: 8px;
}

.comment-text {
    color: var(--text-primary);
    line-height: 1.4;
    font-size: var(--font-xs);
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.comment-stats {
    display: flex;
    gap: 12px;
    cursor: pointer;
}

.comment-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 13px;
}

.comment-stat svg {
    width: 16px;
    height: 16px;
}

.comment-like {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
}

.comment-like:hover {
    color: var(--text-primary);
}

.comment-like.liked {
    color: #ff6b6b;
}

.heart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.heart-icon.liked {
    color: #ff6b6b;
}

.comment-like svg {
    width: 16px;
    height: 16px;
}

.comment-like.liked svg {
    color: #ff6b6b;
}

.comment-reply-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px;
    text-decoration: underline;
}

.comment-reply-btn:hover {
    color: var(--text-primary);
}

.comment-reply-btn svg {
    width: 16px;
    height: 16px;
}

.replying-to-container {
    display: none;
    background-color: var(--bg-secondary);
    padding: 10px 15px;
    font-size: 13px;
    border-top: 1px solid var(--border-color);
}

.replying-to-container.show {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.replying-to-text {
    color: var(--text-secondary);
}

.cancel-reply-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    text-decoration: underline;
}

.no-comments {
    text-align: center;
    color: var(--text-secondary);
    padding: 30px 0;
    font-style: italic;
}

.no-replies {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 13px;
    padding: 5px 0;
}

.nested-replies-container {
    border-left: 2.4px solid var(--border-color);
}

.nested-reply {
    padding-left: 25px;
    border: none;
}

.reply-content:hover {
    background-color: var(--hover-bg);
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.reply-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reply-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.reply-user-details {
    display: flex;
    flex-direction: column;
}

.reply-author {
    font-weight: 500;
    font-size: var(--font-xs);
    color: var(--text-primary);
}

.reply-time {
    font-size: var(--font-size-tiny);
    color: var(--text-secondary);
}

.reply-text-content {
    margin-left: 32px;
}

.reply-text {
    color: var(--text-primary);
    line-height: 1.4;
    font-size: var(--font-xs);
}

.reply-actions {
    margin-top: 5px;
    margin-left: 32px;
}

.reply-actions .comment-reply-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-size-tiny);
    cursor: pointer;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
}

.reply-actions .comment-reply-btn:hover {
    color: var(--text-primary);
}

.reply-actions .comment-reply-btn span {
    margin-left: 3px;
}

/* Edit comment textarea */
.edit-comment-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: var(--font-xs);
    resize: vertical;
    margin-bottom: 10px;
}

/* General styles when any element has focus via keyboard/logic */
textarea.edit-comment-textarea:focus-visible {
    outline: none;
    opacity: 0.9;
}

.edit-comment-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.edit-comment-btn {
    padding: 6px 12px;
    border-radius: 20px;
    border: none;
    font-size: var(--font-xs);
    cursor: pointer;
}

.edit-comment-cancel {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.edit-comment-save {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

.edit-comment-cancel:hover,
.edit-comment-save:hover {
    opacity: 0.9;
}

.bottom-sheet-footer {
    padding: 10px 15px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: var(--font-size-smallest);
    font-weight: 400;
    line-height: 1.3125;
}

/* Responsive adjustments for larger screens */
@media (min-width: 1200px) {
    .bottom-sheet {
        width: 500px;
    }
}

@media (max-width: 1200px) {
    .bottom-sheet {
        width: 420px;
    }
}

/* Responsive adjustments for Smaller screens */
@media (max-width: 768px) {
    .bottom-sheet {
        right: 0;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 100dvh;
        border-radius: 15px 15px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .bottom-sheet.active {
        transform: translateY(0);
    }

}

@media (min-width: 768px) {
    .bottom-sheet-handle {
        display: none;
    }
}


/* Bottom Sheet Two - Centered Modal on Desktop */
@media (min-width: 768px) {
    .bottom-sheet.bottom-sheet-two {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -45%);
        opacity: 0;
        visibility: hidden;
        height: auto;
        width: 500px;
        /* Default desktop width */
        max-width: 90vw;
        max-height: 85vh;
        border-radius: 12px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
        transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, visibility 0.3s;
    }

    .bottom-sheet.bottom-sheet-two.active {
        transform: translate(-50%, -50%);
        opacity: 1;
        visibility: visible;
    }

    .bottom-sheet.bottom-sheet-two .bottom-sheet-header {
        padding: 15px;
    }


    /* Adjust width for smaller desktop screens if needed, 
       mirroring the original bottom-sheet behavior but centered */
    @media (max-width: 1200px) {
        .bottom-sheet.bottom-sheet-two {
            width: 420px;
        }
    }
}

/* Share Sheet Styles moved to components.css */
/* Media Sheet Grid Styles moved to select_media_sheet.css */
