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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Toolbar */
.toolbar {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toolbar-left h1 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.toolbar-center {
    display: flex;
    gap: 20px;
    align-items: center;
}

.toolbar-right {
    display: flex;
    gap: 10px;
}

.file-name {
    color: #666;
    font-size: 14px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tool Groups */
.tool-group {
    display: flex;
    gap: 5px;
    padding: 5px;
    background: #f5f5f5;
    border-radius: 8px;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
}

.tool-btn:hover {
    background: #e0e0e0;
}

.tool-btn.active {
    background: #667eea;
    color: white;
}

.tool-btn svg {
    stroke: currentColor;
}

.tool-btn.active svg {
    stroke: white;
}

/* Color Options */
.color-group {
    display: flex;
    gap: 8px;
    padding: 5px;
    background: #f5f5f5;
    border-radius: 8px;
}

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

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: #333;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #333;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    padding: 20px;
}

.sidebar h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.annotations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-message {
    color: #999;
    font-size: 13px;
    text-align: center;
    padding: 20px;
    line-height: 1.6;
}

.annotation-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid;
}

.annotation-item:hover {
    background: #f0f0f0;
    transform: translateX(2px);
}

.annotation-item .type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
    opacity: 0.7;
}

.annotation-item .content {
    font-size: 13px;
    color: #333;
    margin-bottom: 5px;
    word-wrap: break-word;
}

.annotation-item .page-info {
    font-size: 11px;
    color: #999;
}

.annotation-item .delete-btn {
    float: right;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.annotation-item:hover .delete-btn {
    opacity: 1;
}

/* PDF Viewer */
.pdf-viewer {
    flex: 1;
    overflow-y: auto;
    background: #e0e0e0;
    position: relative;
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
    padding: 40px;
}

.upload-prompt svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.upload-prompt h2 {
    font-size: 24px;
    color: #666;
    margin-bottom: 10px;
}

.upload-prompt p {
    font-size: 14px;
    color: #999;
}

.pdf-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
}

.pdf-page {
    position: relative;
    margin-bottom: 20px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.pdf-page canvas {
    display: block;
    width: 100%;
    height: auto;
}

.annotation-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: all;
    z-index: 10;
}

/* Highlight */
.highlight {
    position: absolute;
    opacity: 0.4;
    cursor: pointer;
    pointer-events: all;
    transition: opacity 0.2s;
}

.highlight:hover {
    opacity: 0.6;
}

.highlight.selected {
    outline: 2px dashed #333;
}

/* Sticky Note */
.sticky-note {
    position: absolute;
    min-width: 200px;
    max-width: 300px;
    background: #FFF9C4;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px;
    cursor: move;
    pointer-events: all;
}

.sticky-note.dragging {
    opacity: 0.7;
    cursor: grabbing;
}

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

.sticky-note-pin {
    font-size: 16px;
}

.sticky-note-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.sticky-note-close:hover {
    opacity: 1;
}

.sticky-note textarea {
    width: 100%;
    min-height: 80px;
    border: none;
    background: transparent;
    resize: vertical;
    font-family: inherit;
    font-size: 13px;
    color: #333;
    outline: none;
}

/* Text Annotation */
.text-annotation {
    position: absolute;
    background: white;
    border: 2px solid;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    max-width: 300px;
    word-wrap: break-word;
    cursor: move;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.text-annotation.editing {
    outline: 2px dashed #667eea;
}

.text-annotation .delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: none;
}

.text-annotation:hover .delete-btn {
    display: block;
}

/* Page Number Badge */
.page-number-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
