* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background-color: #f5f5f5;
}

.toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn {
    background: #2196f3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn:hover {
    background: #1976d2;
}

.color-palette {
    display: flex;
    gap: 8px;
}

.color-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.color-option:hover {
    border-color: #333;
}

.color-option.selected {
    border-color: #000;
    border-width: 3px;
}

.format-hint {
    color: #666;
    padding: 0 10px;
}

.format-hint small {
    font-size: 12px;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

#zoom-level {
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.canvas-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    cursor: grab;
}

.canvas-container.panning {
    cursor: grabbing;
}

.canvas {
    position: relative;
    width: 5000px;
    height: 5000px;
    transform-origin: 0 0;
    transition: transform 0.1s ease-out;
}

.sticky-note {
    position: absolute;
    width: 200px;
    height: 200px;
    background-color: #ffeb3b;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: move;
    user-select: none;
    transition: box-shadow 0.2s, transform 0.1s;
    border: 1px solid rgba(0,0,0,0.1);
}

.sticky-note:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

.sticky-note.dragging {
    transform: rotate(2deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    z-index: 1000;
}

.sticky-note.selected {
    border: 2px solid #2196f3;
}

.note-content {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    padding: 16px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    border-radius: 8px;
    cursor: text;
    overflow-y: auto;
    word-wrap: break-word;
}

.note-content:focus {
    cursor: text;
}

.note-content:empty:before {
    content: attr(data-placeholder);
    opacity: 0.6;
    pointer-events: none;
    color: inherit;
}

.note-content b,
.note-content strong {
    font-weight: bold;
}

.note-content i,
.note-content em {
    font-style: italic;
}

.note-content u {
    text-decoration: underline;
}

.delete-note {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
}

.sticky-note:hover .delete-note {
    display: flex;
}

.delete-note:hover {
    background: #d32f2f;
}

.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-modal.hidden {
    display: none;
}

.login-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-content h2 {
    margin-bottom: 10px;
    color: #333;
}

.login-content p {
    margin-bottom: 25px;
    color: #666;
}

#username-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

#username-input:focus {
    outline: none;
    border-color: #2196f3;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.login-btn:hover {
    background: #1976d2;
}

.login-info {
    margin-top: 20px;
    color: #888;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    font-size: 16px;
    color: #666;
}

@media (max-width: 768px) {
    .toolbar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
        gap: 10px;
    }
    
    .color-palette {
        order: 2;
        flex-basis: 100%;
    }
    
    .zoom-controls {
        margin-left: 0;
    }
    
    .canvas-container {
        top: 80px;
    }
    
    .sticky-note {
        width: 150px;
        height: 150px;
    }
    
    .login-content {
        padding: 30px 20px;
    }
}
