/**
 * PriceONN - Sticky Notes Styles
 * Dashboard sticky notes feature for user annotations
 *
 * @version 1.0
 * @author PriceONN Team
 */

/* ========================================
   STICKY NOTES CONTAINER
   ======================================== */

.sticky-notes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

.sticky-notes-container * {
    pointer-events: auto;
}

/* ========================================
   STICKY NOTE BASE
   ======================================== */

.sticky-note {
    position: absolute;
    min-width: 150px;
    min-height: 100px;
    max-width: 500px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s ease, transform 0.1s ease;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.sticky-note:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.2);
}

.sticky-note.dragging {
    opacity: 0.9;
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    cursor: grabbing;
    z-index: 1000 !important;
}

.sticky-note.resizing {
    opacity: 0.95;
}

/* ========================================
   NOTE COLORS
   ======================================== */

.sticky-note[data-color="yellow"] {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
}

.sticky-note[data-color="blue"] {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #3b82f6;
}

.sticky-note[data-color="green"] {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 1px solid #10b981;
}

.sticky-note[data-color="pink"] {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border: 1px solid #ec4899;
}

.sticky-note[data-color="purple"] {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border: 1px solid #8b5cf6;
}

.sticky-note[data-color="orange"] {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    border: 1px solid #f97316;
}

/* ========================================
   NOTE HEADER
   ======================================== */

.sticky-note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    cursor: grab;
    user-select: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.sticky-note-header:active {
    cursor: grabbing;
}

.sticky-note-drag-handle {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(0, 0, 0, 0.5);
    font-size: 11px;
    font-weight: 600;
}

.sticky-note-drag-handle svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.sticky-note-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.sticky-note-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.sticky-note-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
}

.sticky-note-btn svg {
    width: 12px;
    height: 12px;
}

.sticky-note-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

/* ========================================
   NOTE CONTENT
   ======================================== */

.sticky-note-content {
    flex: 1;
    padding: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sticky-note-textarea {
    flex: 1;
    width: 100%;
    border: none;
    background: transparent;
    color: rgba(0, 0, 0, 0.85);
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    outline: none;
}

.sticky-note-textarea::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* Font sizes */
.sticky-note[data-font-size="small"] .sticky-note-textarea {
    font-size: 11px;
}

.sticky-note[data-font-size="normal"] .sticky-note-textarea {
    font-size: 13px;
}

.sticky-note[data-font-size="large"] .sticky-note-textarea {
    font-size: 15px;
}

/* ========================================
   NOTE FOOTER / TOOLBAR
   ======================================== */

.sticky-note-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.sticky-note-colors {
    display: flex;
    gap: 4px;
}

.sticky-note-color-btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sticky-note-color-btn:hover {
    transform: scale(1.2);
}

.sticky-note-color-btn.active {
    border-color: rgba(0, 0, 0, 0.5);
}

.sticky-note-color-btn[data-color="yellow"] { background: #fbbf24; }
.sticky-note-color-btn[data-color="blue"] { background: #3b82f6; }
.sticky-note-color-btn[data-color="green"] { background: #10b981; }
.sticky-note-color-btn[data-color="pink"] { background: #ec4899; }
.sticky-note-color-btn[data-color="purple"] { background: #8b5cf6; }
.sticky-note-color-btn[data-color="orange"] { background: #f97316; }

.sticky-note-font-sizes {
    display: flex;
    gap: 2px;
}

.sticky-note-font-btn {
    padding: 2px 6px;
    border: none;
    background: transparent;
    color: rgba(0, 0, 0, 0.5);
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sticky-note-font-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
}

.sticky-note-font-btn.active {
    background: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.9);
}

.sticky-note-font-btn[data-size="small"] { font-size: 10px; }
.sticky-note-font-btn[data-size="normal"] { font-size: 12px; }
.sticky-note-font-btn[data-size="large"] { font-size: 14px; }

/* ========================================
   RESIZE HANDLES
   ======================================== */

.sticky-note-resize {
    position: absolute;
    background: transparent;
}

/* Corner handles */
.sticky-note-resize-se {
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: se-resize;
}

.sticky-note-resize-sw {
    left: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: sw-resize;
}

.sticky-note-resize-ne {
    right: 0;
    top: 0;
    width: 16px;
    height: 16px;
    cursor: ne-resize;
}

.sticky-note-resize-nw {
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    cursor: nw-resize;
}

/* Edge handles */
.sticky-note-resize-e {
    right: 0;
    top: 16px;
    bottom: 16px;
    width: 6px;
    cursor: e-resize;
}

.sticky-note-resize-w {
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 6px;
    cursor: w-resize;
}

.sticky-note-resize-n {
    top: 0;
    left: 16px;
    right: 16px;
    height: 6px;
    cursor: n-resize;
}

.sticky-note-resize-s {
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 6px;
    cursor: s-resize;
}

/* Resize indicator (corner) */
.sticky-note-resize-indicator {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 10px;
    height: 10px;
    opacity: 0.4;
    pointer-events: none;
}

.sticky-note-resize-indicator::before,
.sticky-note-resize-indicator::after {
    content: '';
    position: absolute;
    background: rgba(0, 0, 0, 0.4);
}

.sticky-note-resize-indicator::before {
    width: 10px;
    height: 2px;
    bottom: 0;
    right: 0;
    transform: rotate(-45deg);
    transform-origin: bottom right;
}

.sticky-note-resize-indicator::after {
    width: 6px;
    height: 2px;
    bottom: 3px;
    right: 0;
    transform: rotate(-45deg);
    transform-origin: bottom right;
}

/* ========================================
   MINIMIZED STATE
   ======================================== */

.sticky-note.minimized {
    min-height: auto !important;
    height: auto !important;
}

.sticky-note.minimized .sticky-note-content,
.sticky-note.minimized .sticky-note-footer,
.sticky-note.minimized .sticky-note-resize {
    display: none;
}

.sticky-note.minimized .sticky-note-header {
    border-bottom: none;
}

/* ========================================
   ADD NOTE BUTTON (in toolbar)
   ======================================== */

.add-note-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: rgba(0, 212, 170, 0.1);
    border: 1px dashed rgba(0, 212, 170, 0.4);
    border-radius: 8px;
    color: #00d4aa;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.add-note-btn:hover {
    background: rgba(0, 212, 170, 0.2);
    border-color: rgba(0, 212, 170, 0.6);
}

.add-note-btn svg {
    width: 16px;
    height: 16px;
}

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

@media (max-width: 768px) {
    .sticky-note {
        min-width: 120px;
        min-height: 80px;
        max-width: 300px;
        max-height: 300px;
    }

    .sticky-note-header {
        padding: 4px 6px;
    }

    .sticky-note-content {
        padding: 6px;
    }

    .sticky-note-footer {
        padding: 4px 6px;
    }

    .sticky-note-color-btn {
        width: 14px;
        height: 14px;
    }

    .sticky-note-modal {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
        text-align: center;
    }

    .sticky-note-modal-content {
        flex-direction: column;
        gap: 12px;
    }

    .sticky-note-modal-text {
        text-align: center;
    }

    .sticky-note-modal-actions {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   DELETE CONFIRMATION MODAL
   ======================================== */

.sticky-note-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.sticky-note-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sticky-note-modal {
    background: linear-gradient(145deg, #1a1f2e 0%, #0f1219 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(10px);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 16px;
}

.sticky-note-modal-overlay.active .sticky-note-modal {
    transform: scale(1) translateY(0);
}

.sticky-note-modal-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sticky-note-modal-icon svg {
    width: 20px;
    height: 20px;
    color: #ef4444;
}

.sticky-note-modal-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.sticky-note-modal-text {
    flex: 1;
}

.sticky-note-modal-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.sticky-note-modal-message {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

.sticky-note-modal-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.sticky-note-modal-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sticky-note-modal-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.sticky-note-modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sticky-note-modal-btn-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.sticky-note-modal-btn-delete:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}
