/* ============================================================================
   RIGHT SIDEBAR - Wikipedia Dark Mode Theme
   ============================================================================ */

.right-sidebar {
    background: #27292a;
    border-left: 1px solid #3a3b3c;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.2);
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 100;
}

.right-sidebar.show {
    transform: translateX(0);
}

/* Header */
.right-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #3a3b3c;
    background: #202122;
}

.right-sidebar-title {
    font-size: 1.2rem;
    color: #eaecf0;
    margin: 0;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Content */
.right-sidebar-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

/* Property sections */
.property-section {
    margin-bottom: 24px;
}

.property-section h3 {
    font-size: 0.75rem;
    color: #a2a9b1;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.property-item {
    margin-bottom: 16px;
}

.property-label {
    font-size: 0.75rem;
    color: #a2a9b1;
    margin-bottom: 6px;
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.property-value {
    font-size: 0.875rem;
    color: #eaecf0;
    padding: 8px 12px;
    background: #202122;
    border: 1px solid #3a3b3c;
    border-radius: 2px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    word-wrap: break-word;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.property-value.scrollable {
    max-height: 400px;
}

.property-link {
    color: #3366cc;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.property-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Settings controls */
.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    font-size: 0.875rem;
    color: #eaecf0;
    margin-bottom: 6px;
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.setting-item select,
.setting-item input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    background: #202122;
    color: #eaecf0;
    border: 1px solid #3a3b3c;
    border-radius: 2px;
    font-size: 0.875rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    cursor: pointer;
}

.setting-item select:hover,
.setting-item input[type="number"]:hover {
    border-color: #3366cc;
}

.setting-item select:focus,
.setting-item input[type="number"]:focus {
    outline: none;
    border-color: #3366cc;
    box-shadow: 0 0 0 2px rgba(51, 102, 204, 0.2);
}

/* Checkbox items */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3366cc;
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
    flex: 1;
}

.checkbox-item input[type="checkbox"]:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.checkbox-item input[type="checkbox"]:disabled + label {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Close button */
.right-sidebar-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #a2a9b1;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
    line-height: 1;
}

.right-sidebar-close:hover {
    color: #ffffff;
    transform: scale(1.1);
}

/* Scrollbar for right sidebar */
.right-sidebar::-webkit-scrollbar,
.right-sidebar-content::-webkit-scrollbar,
.property-value::-webkit-scrollbar {
    width: 10px;
}

.right-sidebar::-webkit-scrollbar-track,
.right-sidebar-content::-webkit-scrollbar-track,
.property-value::-webkit-scrollbar-track {
    background: #27292a;
}

.right-sidebar::-webkit-scrollbar-thumb,
.right-sidebar-content::-webkit-scrollbar-thumb,
.property-value::-webkit-scrollbar-thumb {
    background: #3a3b3c;
    border-radius: 5px;
    border: 2px solid #27292a;
}

.right-sidebar::-webkit-scrollbar-thumb:hover,
.right-sidebar-content::-webkit-scrollbar-thumb:hover,
.property-value::-webkit-scrollbar-thumb:hover {
    background: #4a4b4c;
}

/* Empty state */
.right-sidebar-empty {
    text-align: center;
    color: #a2a9b1;
    padding: 40px 20px;
    font-size: 0.875rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.right-sidebar-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ============================================================================
   TEXT DIFF IN SIDEBAR
   ============================================================================ */

#diffPreview .diff-added {
    background: rgba(63, 185, 80, 0.2);
    color: #7ee787;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    border-left: 2px solid #3fb950;
    margin: 0 1px;
    display: inline-block;
}

#diffPreview .diff-removed {
    background: rgba(248, 81, 73, 0.2);
    color: #ff7b72;
    padding: 2px 4px;
    border-radius: 3px;
    text-decoration: line-through;
    opacity: 0.8;
    border-left: 2px solid #f85149;
    margin: 0 1px;
    display: inline-block;
}

#diffPreview {
    word-wrap: break-word;
    white-space: pre-wrap;
}