.sticky-note {
    position: absolute;
    width: 200px;
    min-height: 200px;
    height: auto;
    max-height: 400px;
    padding: 16px;
    border-radius: 2px;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.15);
    cursor: move;
    transform: rotate(-1deg);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    user-select: none;
    overflow: visible;
}

.sticky-note:hover {
    transform: scale(1.02) rotate(-1deg);
    box-shadow: 5px 5px 12px rgba(0,0,0,0.2);
}

.note-color-1 {
    background: #fef08a;
    transform: rotate(-1deg);
}

.note-color-2 {
    background: #fde68a;
    transform: rotate(1deg);
}

.note-color-3 {
    background: #fcd34d;
    transform: rotate(-2deg);
}

.note-content {
    width: 100%;
    flex: 1;
    min-height: 150px;
    background: transparent;
    border: none;
    resize: none;
    font-family: 'Comic Sans MS', cursive;
    line-height: 1.5;
    overflow-y: auto;
    user-select: text;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}

.note-content:focus {
    outline: none;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    user-select: none;
}

.note-drag-handle {
    cursor: move;
    user-select: none;
}

.delete-note {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    user-select: none;
}

.delete-note:hover {
    color: #ff4444;
}

.tool-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.tool-button i {
    font-size: 1rem;
}

.connection-area {
    backdrop-filter: blur(8px);
    transition: transform 0.3s, opacity 0.3s;
}

.connection-area.collapsed {
    transform: translateX(calc(100% - 40px));
}

.connection-area .collapse-btn {
    position: absolute;
    left: -36px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #e5e7eb;
    border-right: none;
    padding: 8px;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

@keyframes fadeOut {
    from { 
        opacity: 1; 
        transform: scale(1) rotate(-1deg); 
    }
    to { 
        opacity: 0; 
        transform: scale(0.8) rotate(-5deg); 
    }
}

@media (max-width: 640px) {
    .connection-area {
        width: calc(100% - 32px);
        margin: 16px;
    }
    
    .tool-button span {
        display: none;
    }
    
    .tool-button {
        padding: 8px;
    }
}

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

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

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 400px;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.modal-btn-primary {
    background: #ef4444;
    color: white;
    border: none;
}

.modal-btn-primary:hover {
    background: #dc2626;
}

.modal-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.modal-btn-secondary:hover {
    background: #e5e7eb;
}

.resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: se-resize;
    opacity: 0.6;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.1);
    border-radius: 0 0 2px 0;
}

.resize-handle::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(0,0,0,0.4);
    border-bottom: 2px solid rgba(0,0,0,0.4);
}

.resize-handle:hover {
    opacity: 1;
    background: rgba(0,0,0,0.15);
}

.sticky-note.resizing {
    transition: none;
    user-select: none;
}

.note-content::-webkit-scrollbar {
    width: 6px;
}

.note-content::-webkit-scrollbar-track {
    background: transparent;
}

.note-content::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}

.note-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0,0,0,0.3);
}
