/**
 * Content Sharing & Inline Editor Styles
 */

/* =====================================================
   SHARE MODAL
   ===================================================== */

.share-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
}

.share-modal {
    background: var(--card-background, #ffffff);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color, #eee);
}

.share-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-color, #333);
}

.share-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-color-secondary, #666);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.share-modal-close:hover {
    background: var(--hover-background, #f0f0f0);
}

.share-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Share Type Selector */
.share-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.share-type-option {
    flex: 1;
    cursor: pointer;
}

.share-type-option input {
    display: none;
}

.share-type-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid var(--border-color, #ddd);
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
}

.share-type-option input:checked + .share-type-label {
    border-color: var(--primary-color, #4AAEDC);
    background: rgba(74, 174, 220, 0.05);
}

.share-type-label i {
    font-size: 24px;
    color: var(--primary-color, #4AAEDC);
    margin-bottom: 8px;
}

.share-type-label strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-color, #333);
}

.share-type-label small {
    color: var(--text-color-secondary, #666);
    font-size: 12px;
}

/* Quote Comment Area */
.quote-comment-area {
    margin-bottom: 20px;
}

.quote-comment-area label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color, #333);
}

.quote-comment-area textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    background: var(--input-background, #fff);
    color: var(--text-color, #333);
}

.quote-comment-area textarea:focus {
    outline: none;
    border-color: var(--primary-color, #4AAEDC);
}

/* Share Target Selector */
.share-target-selector {
    margin-bottom: 20px;
}

.share-target-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color, #333);
}

.share-target-selector select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 14px;
    background: var(--input-background, #fff);
    color: var(--text-color, #333);
}

/* Share Preview */
.share-preview {
    background: var(--card-background-secondary, #f5f5f5);
    border-radius: 8px;
    padding: 15px;
}

.share-preview-loading {
    text-align: center;
    color: var(--text-color-secondary, #666);
    padding: 20px;
}

.share-preview-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-preview-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-preview-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.share-preview-username {
    font-weight: 500;
    color: var(--text-color, #333);
}

.share-preview-indicator {
    padding: 15px;
    background: var(--card-background, #fff);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color, #4AAEDC);
    color: var(--text-color-secondary, #666);
    font-style: italic;
}

.share-preview-indicator i {
    margin-right: 8px;
    color: var(--primary-color, #4AAEDC);
}

.share-warning {
    margin: 10px 0 0;
    padding: 10px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 6px;
    color: #856404;
    font-size: 13px;
}

.share-preview-error {
    color: #dc3545;
    text-align: center;
    padding: 20px;
}

/* Share Modal Footer */
.share-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color, #eee);
}

.share-modal-footer .btn-cancel {
    padding: 10px 20px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: transparent;
    color: var(--text-color, #333);
    cursor: pointer;
    transition: background 0.2s;
}

.share-modal-footer .btn-cancel:hover {
    background: var(--hover-background, #f0f0f0);
}

.share-modal-footer .btn-share {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color, #4AAEDC);
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.share-modal-footer .btn-share:hover {
    background: var(--primary-color-dark, #3a9ecb);
}

.share-modal-footer .btn-share:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =====================================================
   SHARE BUTTON IN CONTENT
   Note: Main .content-share-btn styles are in style-new.css/darkmode.css
   with gradient borders. Only add additional styles here.
   ===================================================== */

.share-count {
    font-size: 13px;
}

/* Shared Content Attribution */
.shared-content-attribution {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    margin-bottom: 10px;
    background: var(--card-background-secondary, #f5f5f5);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-color-secondary, #666);
}

.shared-content-attribution i {
    color: var(--primary-color, #4AAEDC);
}

.shared-content-attribution a {
    color: var(--text-color, #333);
    font-weight: 500;
    text-decoration: none;
}

.shared-content-attribution a:hover {
    text-decoration: underline;
}

.shared-original-content {
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    background: var(--card-background, #fff);
}

/* =====================================================
   INLINE EDITOR
   ===================================================== */

.content-item.editing,
.content-feed-item.editing {
    background: var(--card-background, #fff);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.inline-edit-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.inline-edit-toolbar-area {
    min-height: 40px;
}

.inline-edit-content {
    min-height: 150px;
}

.inline-edit-textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    background: var(--input-background, #fff);
    color: var(--text-color, #333);
}

.inline-edit-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 0;
    border-top: 1px solid var(--border-color, #eee);
}

.inline-edit-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-edit-option label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-color, #333);
    cursor: pointer;
}

.inline-edit-privacy {
    padding: 6px 10px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    font-size: 13px;
    background: var(--input-background, #fff);
    color: var(--text-color, #333);
}

.inline-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color, #eee);
}

.inline-edit-actions .btn-cancel,
.inline-edit-cancel {
    padding: 8px 16px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: transparent;
    color: var(--text-color, #333);
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.inline-edit-actions .btn-cancel:hover,
.inline-edit-cancel:hover {
    background: var(--hover-background, #f0f0f0);
}

.inline-edit-actions .btn-primary,
.inline-edit-save {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color, #4AAEDC);
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.inline-edit-actions .btn-primary:hover,
.inline-edit-save:hover {
    background: var(--primary-color-dark, #3a9ecb);
}

.inline-edit-actions .btn-primary:disabled,
.inline-edit-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Edit Button */
.inline-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-color-secondary, #666);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.inline-edit-btn:hover {
    background: var(--hover-background, #f0f0f0);
    color: var(--primary-color, #4AAEDC);
}

/* Inline Editor Container (new JS-based editor) */
/* Dark mode (default - no class) */
.inline-editor-container {
    padding: 15px;
    background: #2a2a2a;
    border-radius: 8px;
    margin: 10px 0;
}

.inline-editor-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    padding: 12px 0;
    border-top: 1px solid #444;
    margin-top: 10px;
}

.inline-editor-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-editor-option label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #e0e0e0;
    white-space: nowrap;
}

.inline-editor-option label i {
    color: #999;
}

.inline-privacy-select {
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 14px;
    background: #1e1e1e;
    color: #e0e0e0;
    cursor: pointer;
    min-width: 150px;
}

.inline-privacy-select:focus {
    outline: none;
    border-color: #4AAEDC;
}

.inline-editor-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #444;
    margin-top: 10px;
}

.inline-editor-actions .btn-cancel-edit {
    padding: 10px 20px;
    border: 1px solid #444;
    border-radius: 6px;
    background: transparent;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.inline-editor-actions .btn-cancel-edit:hover {
    background: #333;
}

.inline-editor-actions .btn-save-edit {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: #4AAEDC;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.inline-editor-actions .btn-save-edit:hover {
    background: #3a9ecb;
}

.inline-editor-actions .btn-save-edit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.edit-reason-label {
    font-size: 14px;
    color: #999;
    white-space: nowrap;
}

.edit-reason-input {
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 14px;
    background: #1e1e1e;
    color: #e0e0e0;
    min-width: 150px;
    flex: 1;
}

.edit-reason-input:focus {
    outline: none;
    border-color: #4AAEDC;
}

.inline-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #e0e0e0;
}

.inline-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4AAEDC;
}

.inline-checkbox-label i {
    color: #999;
}

/* Comments Disabled State */
.content-comments-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

.comments-disabled-message {
    padding: 20px;
    text-align: center;
    color: #888;
    font-style: italic;
}

/* =====================================================
   DARK MODE
   ===================================================== */

[data-theme="dark"] .share-modal,
.dark-mode .share-modal {
    background: var(--card-background-dark, #2a2a2a);
}

[data-theme="dark"] .share-type-label,
.dark-mode .share-type-label {
    border-color: var(--border-color-dark, #444);
}

[data-theme="dark"] .share-preview,
.dark-mode .share-preview {
    background: var(--card-background-secondary-dark, #333);
}

[data-theme="dark"] .share-preview-indicator,
.dark-mode .share-preview-indicator {
    background: var(--card-background-dark, #2a2a2a);
}

[data-theme="dark"] .shared-content-attribution,
.dark-mode .shared-content-attribution {
    background: var(--card-background-secondary-dark, #333);
}

/* Inline Editor Light Mode (dark-mode class = light mode) */
.dark-mode .inline-editor-container {
    background: #ffffff;
}

.dark-mode .inline-editor-options {
    border-top-color: #e0e0e0;
}

.dark-mode .inline-editor-option label {
    color: #333;
}

.dark-mode .inline-editor-option label i {
    color: #666;
}

.dark-mode .inline-privacy-select {
    background: #fff;
    border-color: #ddd;
    color: #333;
}

.dark-mode .inline-editor-actions {
    border-top-color: #e0e0e0;
}

.dark-mode .inline-editor-actions .btn-cancel-edit {
    border-color: #ddd;
    color: #333;
}

.dark-mode .inline-editor-actions .btn-cancel-edit:hover {
    background: #f0f0f0;
}

.dark-mode .edit-reason-label {
    color: #666;
}

.dark-mode .edit-reason-input {
    background: #fff;
    border-color: #ddd;
    color: #333;
}

.dark-mode .inline-checkbox-label {
    color: #333;
}

.dark-mode .inline-checkbox-label i {
    color: #666;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 600px) {
    .share-modal-overlay {
        padding: 10px;
    }

    .share-modal {
        max-height: 95vh;
    }

    .share-type-selector {
        flex-direction: column;
    }

    .inline-edit-options,
    .inline-editor-options {
        flex-direction: column;
        gap: 10px;
    }

    .inline-edit-actions,
    .inline-editor-actions {
        flex-direction: column;
    }

    .inline-edit-actions button,
    .inline-editor-actions button {
        width: 100%;
        justify-content: center;
    }
}
