/* Base-2 Canvas - Panel Styles */

.panel {
    width: var(--panel-width);
    min-width: var(--panel-min-width);
    max-width: var(--panel-max-width);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.panel-left {
    border-right: 1px solid var(--border-color);
}

.panel-right {
    border-left: 1px solid var(--border-color);
}

/* Panel resize handle */
.panel-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: ew-resize;
    background: transparent;
    z-index: 10;
    transition: background 0.15s;
}

.panel-resize-handle:hover,
.panel-resize-handle.active {
    background: var(--accent-primary);
}

.panel-left .panel-resize-handle {
    right: -3px;
}

.panel-right .panel-resize-handle {
    left: -3px;
}

.panel-header {
    height: 32px;
    padding: 0 var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.panel-section {
    margin-bottom: var(--spacing-lg);
}

.panel-section-title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

/* Property rows */
.property-row {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.property-label {
    width: 70px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.property-value {
    flex: 1;
    display: flex;
    gap: var(--spacing-xs);
}

/* Input styles */
.input-field {
    flex: 1;
    height: 26px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    padding: 0 var(--spacing-sm);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.input-field:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-small {
    width: 50px;
    flex: none;
}

/* Color picker */
.color-picker {
    width: 26px;
    height: 26px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* Layers panel */
.layer-add-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.15s;
}

.layer-add-btn:hover {
    background: var(--accent-hover);
}

.layer-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.layer-item {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    gap: var(--spacing-sm);
}

.layer-item:hover {
    background: var(--bg-hover);
}

.layer-item.selected {
    background: var(--accent-primary);
}

.layer-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.layer-name {
    flex: 1;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layer-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s, background 0.15s;
}

.layer-btn:hover {
    opacity: 1;
    background: var(--bg-hover);
}

.layer-btn.active {
    opacity: 1;
}

.layer-item.locked {
    opacity: 0.6;
}

.layer-item.locked .layer-name {
    font-style: italic;
}

.layer-item.is-hidden {
    opacity: 0.4;
}

.layer-item.is-hidden .layer-name {
    text-decoration: line-through;
}

.layer-item.dragging {
    opacity: 0.5;
}

.layer-item.drag-over {
    border-top: 2px solid var(--accent-primary);
}

/* Layer Groups (Tree View) */
.layer-group {
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
}

.layer-group.selected {
    border-color: var(--accent-primary);
    background: rgba(74, 158, 255, 0.05);
}

.layer-group.dragging {
    opacity: 0.5;
}

.layer-group.drag-over {
    border-color: var(--accent-primary);
    background: rgba(74, 158, 255, 0.1);
}

.layer-header {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    gap: var(--spacing-xs);
    background: var(--bg-tertiary);
}

.layer-header:hover {
    background: var(--bg-hover);
}

.layer-header.locked {
    opacity: 0.6;
}

.layer-header.is-hidden {
    opacity: 0.4;
}

.layer-expand-btn {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.layer-expand-btn:hover {
    color: var(--text-primary);
}

.layer-count {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.layer-objects {
    padding-left: 20px;
    overflow: hidden;
}

.layer-objects.collapsed {
    display: none;
}

.layer-objects .layer-item {
    border-left: 2px solid var(--border-color);
    margin-left: 6px;
    padding-left: calc(var(--spacing-sm) + 4px);
}

.layer-objects .layer-item:first-child {
    margin-top: 2px;
}

.layer-objects .layer-item:last-child {
    margin-bottom: 4px;
}

.layer-empty {
    padding: 8px 16px;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-style: italic;
}

/* Textarea in properties */
.panel-content textarea.input-field {
    min-height: 60px;
    font-family: inherit;
}

/* Range input */
.panel-content input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
}

.panel-content input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
}

/* Checkbox styling */
.property-value input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Select styling */
.panel-content select.input-field {
    background: var(--bg-tertiary);
    cursor: pointer;
}

/* Collapsible sections */
.collapsible {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    cursor: pointer;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.collapsible-header:hover {
    background: var(--bg-hover);
}

.collapsible-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

.collapsible.open .collapsible-arrow {
    transform: rotate(90deg);
}

.collapsible-content {
    padding: var(--spacing-md);
    display: none;
}

.collapsible.open .collapsible-content {
    display: block;
}

/* Origin point grid */
.origin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    width: 54px;
    padding: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.origin-point {
    width: 14px;
    height: 14px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.origin-point:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.origin-point.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Gradient Editor */
.gradient-editor {
    margin-top: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
}

.gradient-preview {
    height: 24px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--border-color);
    position: relative;
    cursor: pointer;
}

.gradient-stops {
    position: relative;
    height: 20px;
    margin-bottom: var(--spacing-sm);
}

.gradient-stop {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    border-radius: 2px;
    transform: translateX(-50%);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    top: 4px;
}

.gradient-stop:hover {
    transform: translateX(-50%) scale(1.1);
}

.gradient-stop.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary);
}

.gradient-stop-controls {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    margin-top: var(--spacing-sm);
}

.gradient-stop-controls .color-picker {
    flex-shrink: 0;
}

.gradient-stop-controls .input-field {
    width: 60px;
    flex: none;
}

.gradient-buttons {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.gradient-btn {
    flex: 1;
    height: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.gradient-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.gradient-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Fill type selector */
.fill-type-selector {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.fill-type-btn {
    flex: 1;
    height: 22px;
    background: transparent;
    border: none;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.fill-type-btn:hover {
    background: var(--bg-hover);
}

.fill-type-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* ==================== Keyboard Shortcuts Panel ==================== */

.shortcuts-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.shortcuts-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Floating state - position is set via JS */
.shortcuts-panel.floating {
    transform: none !important;
}

.shortcuts-panel.floating.visible {
    transform: none !important;
}

/* Dragging state */
.shortcuts-panel.dragging {
    cursor: grabbing;
    user-select: none;
    transition: none;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

/* Docked states */
.shortcuts-panel.docked-left {
    top: 48px;
    left: 0;
    bottom: 28px;
    width: 320px;
    max-width: 320px;
    max-height: none;
    border-radius: 0;
    transform: none;
    border-left: none;
    border-top: none;
    border-bottom: none;
}

.shortcuts-panel.docked-right {
    top: 48px;
    right: 0;
    left: auto;
    bottom: 28px;
    width: 320px;
    max-width: 320px;
    max-height: none;
    border-radius: 0;
    transform: none;
    border-right: none;
    border-top: none;
    border-bottom: none;
}

.shortcuts-panel.docked-bottom {
    bottom: 28px;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    height: 280px;
    max-height: 280px;
    border-radius: 0;
    transform: none;
    border-bottom: none;
    border-left: none;
    border-right: none;
}

.shortcuts-panel.docked-left.visible,
.shortcuts-panel.docked-right.visible,
.shortcuts-panel.docked-bottom.visible {
    transform: none;
}

/* Docked panel adjustments */
.shortcuts-panel.docked-bottom .shortcuts-categories {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.shortcuts-panel.docked-bottom .shortcuts-category {
    flex: 1 1 200px;
    min-width: 180px;
}

.shortcuts-panel.docked-left .shortcuts-panel-header,
.shortcuts-panel.docked-right .shortcuts-panel-header {
    border-radius: 0;
}

.shortcuts-panel.docked-bottom .shortcuts-panel-header {
    border-radius: 0;
}

.shortcuts-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    cursor: grab;
}

.shortcuts-panel.dragging .shortcuts-panel-header {
    cursor: grabbing;
}

.shortcuts-header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.shortcuts-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.shortcuts-drag-indicator {
    color: var(--text-muted);
    font-size: 14px;
    cursor: grab;
}

.shortcuts-panel.dragging .shortcuts-drag-indicator {
    cursor: grabbing;
}

.shortcuts-dock-buttons {
    display: flex;
    gap: 2px;
    margin-right: var(--spacing-sm);
}

.shortcuts-dock-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.shortcuts-dock-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.shortcuts-dock-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.shortcuts-panel-header h2 {
    margin: 0;
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}

.shortcuts-close-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.shortcuts-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Dock zone indicators */
body.dock-zone-left::before,
body.dock-zone-right::before,
body.dock-zone-bottom::before {
    content: '';
    position: fixed;
    background: var(--accent-primary);
    opacity: 0.3;
    z-index: 9999;
    pointer-events: none;
}

body.dock-zone-left::before {
    left: 0;
    top: 48px;
    width: 60px;
    bottom: 28px;
}

body.dock-zone-right::before {
    right: 0;
    top: 48px;
    width: 60px;
    bottom: 28px;
}

body.dock-zone-bottom::before {
    left: 0;
    right: 0;
    bottom: 28px;
    height: 60px;
}

/* Resize handle for future resizing */
.shortcuts-resize-handle {
    display: none;
}

.shortcuts-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

.shortcuts-search {
    margin-bottom: var(--spacing-lg);
}

.shortcuts-search-input {
    width: 100%;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-md);
    padding: 0 var(--spacing-md);
}

.shortcuts-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.shortcuts-search-input::placeholder {
    color: var(--text-muted);
}

.shortcuts-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.shortcuts-category {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.shortcuts-category-title {
    margin: 0 0 var(--spacing-sm) 0;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: var(--spacing-xs) 0;
}

.shortcut-key {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.shortcut-key .key-modifier {
    color: var(--accent-primary);
    font-weight: 500;
}

.shortcut-key .key-separator {
    color: var(--text-muted);
    margin: 0 1px;
}

.shortcut-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-align: right;
    flex: 1;
}

.shortcuts-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
    font-size: var(--font-size-md);
}

/* Panel hidden state */
.panel.hidden {
    display: none;
}

/* =====================================================
   Project Colors Swatches
   ===================================================== */

.color-picker-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.color-picker-wrapper.compact {
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.color-picker-wrapper.compact .project-colors-swatches {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 120px;
    scrollbar-width: thin;
}

.project-colors-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 2px 0;
}

.project-color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    flex-shrink: 0;
}

.project-color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.project-color-swatch:active {
    transform: scale(1.05);
}

.project-color-add {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px dashed var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    flex-shrink: 0;
}

.project-color-add:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--bg-hover);
}

/* Compact mode adjustments */
.color-picker-wrapper.compact .color-picker {
    width: 32px;
    height: 24px;
}

/* Override for color picker in compact wrapper */
.color-picker-wrapper .color-picker {
    flex-shrink: 0;
}

/* =====================================================
   Alignment & Distribution Controls
   ===================================================== */

.align-buttons-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.align-btn {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.align-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.align-btn:active {
    background: var(--accent-primary);
    color: white;
}

/* Distribution Controls */
.distribute-controls {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.distribute-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--border-color);
}

.distribute-row:last-of-type {
    border-bottom: none;
}

.distribute-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.distribute-info {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.distribute-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.distribute-btn {
    width: 28px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}

.distribute-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.distribute-btn:active:not(:disabled) {
    background: var(--accent-primary);
    color: white;
}

.distribute-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.distribute-gap-input {
    width: 60px;
    flex: 1;
}

/* Distribution Details */
.distribute-details {
    margin-top: var(--spacing-xs);
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-xs);
}

.distribute-details-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    padding: var(--spacing-xs) 0;
}

.distribute-details-toggle:hover {
    color: var(--text-secondary);
}

.toggle-icon {
    font-size: 10px;
}

.distribute-details-content {
    padding: var(--spacing-sm) 0;
}

.detail-section {
    margin-bottom: var(--spacing-sm);
}

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

.detail-section strong {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.detail-row {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
    padding: 2px 0;
}

.detail-row.gaps {
    word-break: break-all;
}

/* =====================================================
   Project Notes Panel
   ===================================================== */

.notes-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 450px;
    max-width: 90vw;
    height: 400px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.notes-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.notes-panel.floating {
    transform: none !important;
}

.notes-panel.floating.visible {
    transform: none !important;
}

.notes-panel.dragging {
    cursor: grabbing;
    user-select: none;
    transition: none;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

/* Docked states */
.notes-panel.docked-left {
    top: 48px;
    left: 0;
    bottom: 28px;
    width: 350px;
    height: auto;
    max-width: 350px;
    max-height: none;
    border-radius: 0;
    transform: none;
    border-left: none;
    border-top: none;
    border-bottom: none;
}

.notes-panel.docked-right {
    top: 48px;
    right: 0;
    left: auto;
    bottom: 28px;
    width: 350px;
    height: auto;
    max-width: 350px;
    max-height: none;
    border-radius: 0;
    transform: none;
    border-right: none;
    border-top: none;
    border-bottom: none;
}

.notes-panel.docked-bottom {
    bottom: 28px;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    height: 250px;
    max-height: 250px;
    border-radius: 0;
    transform: none;
    border-bottom: none;
    border-left: none;
    border-right: none;
}

.notes-panel.docked-left.visible,
.notes-panel.docked-right.visible,
.notes-panel.docked-bottom.visible {
    transform: none;
}

.notes-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    cursor: grab;
    flex-shrink: 0;
}

.notes-panel.dragging .notes-panel-header {
    cursor: grabbing;
}

.notes-panel.docked-left .notes-panel-header,
.notes-panel.docked-right .notes-panel-header,
.notes-panel.docked-bottom .notes-panel-header {
    border-radius: 0;
}

.notes-header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.notes-header-left h2 {
    margin: 0;
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}

.notes-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.notes-drag-indicator {
    color: var(--text-muted);
    font-size: 14px;
    cursor: grab;
}

.notes-panel.dragging .notes-drag-indicator {
    cursor: grabbing;
}

.notes-dock-buttons {
    display: flex;
    gap: 2px;
    margin-right: var(--spacing-sm);
}

.notes-dock-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.notes-dock-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.notes-dock-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.notes-close-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.notes-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Toolbar */
.notes-panel-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.notes-format-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.notes-format-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.notes-format-btn:active {
    background: var(--accent-primary);
    color: white;
}

.notes-toolbar-separator {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 var(--spacing-xs);
}

/* Content area */
.notes-panel-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notes-editor {
    flex: 1;
    padding: var(--spacing-md);
    font-size: var(--font-size-md);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-y: auto;
    outline: none;
}

.notes-editor:empty::before {
    content: attr(placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.notes-editor ul,
.notes-editor ol {
    margin: var(--spacing-xs) 0;
    padding-left: var(--spacing-lg);
}

.notes-editor li {
    margin: var(--spacing-xs) 0;
}

/* Footer */
.notes-panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-md);
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    flex-shrink: 0;
}

.notes-status {
    color: var(--text-secondary);
}

.notes-char-count {
    font-family: var(--font-mono);
}

/* =====================================================
   Modal Dialog
   ===================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    min-width: 280px;
    max-width: 90vw;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-content {
    padding: var(--spacing-lg);
    color: var(--text-primary);
}

.modal-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

.modal-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.modal-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.modal-btn.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.modal-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Preset color buttons */
.preset-color-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s;
}

.preset-color-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
