/* =============================================
   NOTES WINDOW STYLES - Окно заметок
   ============================================= */

/* Кнопка открытия заметок использует существующую rp-btn-4 из right-panel */
/* Стили для кнопки уже определены в right-panel */

/* Окно заметок */
.notes-window {
    position: fixed;
    width: 400px;
    height: 500px;
    min-width: 300px;
    min-height: 300px;
    max-width: 90vw;
    max-height: 90vh;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 201;
    overflow: auto;
    resize: both;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    visibility: hidden;
}

.notes-window.open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    visibility: visible;
}

/* Заголовок окна (для drag & drop) */
.notes-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #FAFAFA;
    border-bottom: 1px solid #ECEEFF;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}

.notes-window-title {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    margin: 0;
}

.notes-window-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0,0,0,0.5);
    border-radius: 4px;
    transition: all 0.2s ease;
    padding: 0;
}

.notes-window-close:hover {
    background: #F3F4F6;
    color: #000000;
}

.notes-window-close svg {
    width: 18px;
    height: 18px;
}

/* Область контента */
.notes-window-content {
    flex: 1;
    position: relative;
    overflow: auto;
    background: #FFFFFF;
    min-height: 0;
}

/* Canvas для рисования */
.notes-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
    background: #FFFFFF;
    display: block;
}

/* Текстовые блоки поверх canvas */
.notes-text-block {
    position: absolute;
    padding: 2px 4px;
    background: transparent;
    border: none;
    cursor: text;
    z-index: 10;
    display: inline-block;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #000000;
    outline: none;
    min-width: 20px;
    user-select: text;
}


.notes-text-block:focus {
    outline: none;
}

.notes-text-block:empty:before {
    content: attr(data-placeholder);
    color: rgba(0,0,0,0.3);
}

.notes-text-block:empty:focus:before {
    content: '';
}

.notes-text-block .text-block-handle {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(107, 114, 128, 0.1);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 11;
    pointer-events: auto;
}

.notes-text-block:hover .text-block-handle,
.notes-text-block:focus-within .text-block-handle {
    display: flex;
}

.notes-text-block .text-block-handle:hover {
    background: rgba(239, 68, 68, 0.2);
    opacity: 1;
}

.notes-text-block .text-block-handle svg {
    width: 12px;
    height: 12px;
    color: rgba(0,0,0,0.5);
}

.notes-text-block .text-block-handle:hover svg {
    color: #EF4444;
}

/* Панель инструментов */
.notes-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #FAFAFA;
    border-top: 1px solid #ECEEFF;
    flex-shrink: 0;
}

.notes-toolbar-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ECEEFF;
    background: #FFFFFF;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    color: rgba(0,0,0,0.5);
}

.notes-toolbar-btn:hover {
    background: #F2F4FF;
    border-color: #ECEEFF;
    color: rgba(0,0,0,0.8);
}

.notes-toolbar-btn.active {
    background: #3F3FE6;
    border-color: #3F3FE6;
    color: #FFFFFF;
}

.notes-toolbar-btn svg {
    width: 18px;
    height: 18px;
    color: inherit;
}

.notes-toolbar-btn.active svg {
    color: #FFFFFF;
}


.notes-toolbar-separator {
    width: 1px;
    height: 24px;
    background: #ECEEFF;
    margin: 0 4px;
}

/* Индикатор сохранения */
.notes-save-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #FFFFFF;
    font-size: 11px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
    pointer-events: none;
}

.notes-save-indicator.show {
    opacity: 1;
}

.notes-save-indicator.saving {
    background: rgba(63, 63, 230, 0.9);
}

.notes-save-indicator.saved {
    background: rgba(34, 197, 94, 0.9);
}

/* Resize handle для окна - используем стандартный CSS resize */
.notes-window::-webkit-resizer {
    background: linear-gradient(135deg, transparent 0%, transparent 40%, #ECEEFF 40%, #ECEEFF 45%, transparent 45%, transparent 50%, #ECEEFF 50%, #ECEEFF 55%, transparent 55%, transparent 60%, #ECEEFF 60%, #ECEEFF 65%, transparent 65%);
    border-bottom-right-radius: 12px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .notes-window {
        width: 90vw;
        height: 70vh;
    }
}

