/* Sidebar Styles */
.settings-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Initially hidden off-screen */
    width: 400px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e0e6ed;
}

.settings-sidebar.open {
    right: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e6ed;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    color: #1a202c;
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sidebar-close:hover {
    background-color: #e2e8f0;
}

/* Sidebar Body */
.sidebar-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h4 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.sidebar-action {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #ffffff;
    text-decoration: none;
    color: inherit;
}

.sidebar-action:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateX(-2px);
}

.sidebar-action-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-action-content {
    flex: 1;
}

.sidebar-action-title {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.sidebar-action-desc {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Column Width Control */
.sidebar-width-control {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.width-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.width-control-label {
    font-weight: 500;
    color: #374151;
}

.width-control-value {
    font-family: monospace;
    color: #059669;
    font-weight: 600;
}

.width-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    transition: background 0.3s;
}

.width-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.width-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Settings toggle button */
.settings-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    font-size: 1.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-toggle:hover {
    background-color: #f1f5f9;
    color: #334155;
}

/* Board Color Selection */
.board-color-section {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.board-color-palette {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.board-color-option {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.board-color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.board-color-option.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.board-color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.transparency-control {
    margin-top: 1rem;
}

.transparency-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.transparency-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.transparency-value {
    font-family: monospace;
    color: #059669;
    font-weight: 600;
    font-size: 0.875rem;
}

.transparency-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right #ffffff, transparent);
    outline: none;
    transition: background 0.3s;
}

.transparency-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.transparency-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.color-preview {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.875rem;
    color: #374151;
    background: white;
}

.color-preview-sample {
    height: 30px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Plugin Settings Styles */
.sidebar-setting {
    margin-bottom: 1rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: #374151;
    gap: 0.75rem;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    transition: background 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="checkbox"]:checked + .toggle-slider {
    background: #22c55e;
}

input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
}

#settings-sidebar input[type="checkbox"] {
    display: none;
}

.setting-info {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.setting-info strong {
    color: #374151;
}

#quill-status {
    font-weight: 600;
}

.setting-description {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
    padding: 0.5rem;
    background: #f1f5f9;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

/* Responsive */
@media (max-width: 768px) {
    .settings-sidebar {
        width: 100vw;
        right: -100vw;
    }
    
    .sidebar-body {
        padding: 1rem;
    }
    
    .sidebar-section {
        margin-bottom: 1.5rem;
    }
}
