* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f5f7;
    height: 100vh;
    color: #1d1d1f;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #ffffff;
}

.toolbar {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.toolbar-section {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 0 8px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.toolbar-section:last-child {
    border-right: none;
}

/* Toolbar button animations */
.tool-btn {
    background-color: transparent;
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    color: #1d1d1f;
    font-size: 13px;
    min-width: 32px;
    justify-content: center;
    transform-origin: center;
    position: relative;
}

.tool-btn i {
    font-size: 16px;
}

.tool-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.tool-btn.active {
    background-color: rgba(0, 122, 255, 0.1);
    color: #007AFF;
}

.tool-btn:hover i {
    transform: scale(1.15);
}

.tool-btn:active i {
    transform: scale(0.95);
}

.tool-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 6px;
    left: 0;
    top: 0;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-btn:hover::after {
    opacity: 1;
    transform: scale(1);
}

.tool-btn.active {
    background-color: rgba(0, 122, 255, 0.1);
    color: #007AFF;
    animation: toolActivate 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes toolActivate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* Add a subtle pulse animation for certain actions */
.tool-btn[data-tool="draw"] i,
.tool-btn[data-tool="highlight"] i,
.tool-btn[data-tool="eraser"] i {
    animation: subtlePulse 2s infinite;
}

@keyframes subtlePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Add a rotating animation for loading states */
.tool-btn.loading i {
    animation: loadingSpin 1s linear infinite;
}

@keyframes loadingSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.editor-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    background-color: #f5f5f7;
}

.sidebar {
    width: 220px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.thumbnails {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thumbnail-container {
    position: relative;
    border-radius: 8px;
    overflow: visible;
}

.thumbnail {
    position: relative;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.delete-page-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #ff3b30;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.thumbnail-container:hover .delete-page-btn {
    opacity: 1;
    transform: scale(1);
}

.delete-page-btn:hover {
    background-color: #ff2d55;
    transform: scale(1.1);
}

.thumbnail.active {
    border-color: #007AFF;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.thumbnail:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.main-content {
    flex: 1;
    overflow: auto;
    position: relative;
    background-color: #f5f5f7;
    padding: 20px;
}

.pdf-viewer {
    position: relative;
    overflow: auto;
    width: 100%;
    height: 100%;
}

.pdf-canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.editor-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    pointer-events: auto !important;
    z-index: 2 !important;
}

.properties-panel {
    width: 280px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.tool-properties h3 {
    margin-bottom: 16px;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 600;
}

.property-group {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.property-group.active {
    display: flex;
}

select, input[type="number"] {
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-size: 13px;
    background-color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

select:focus, input[type="number"]:focus {
    border-color: #007AFF;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

input[type="color"] {
    width: 100%;
    height: 40px;
    padding: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    cursor: pointer;
}

#pageInfo {
    padding: 0 8px;
    color: #666;
    font-size: 13px;
}

.text-edit-menu {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 1000;
}

.text-edit-menu button {
    display: block;
    width: 100%;
    padding: 6px 12px;
    margin: 4px 0;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
}

.text-edit-menu button:hover {
    background-color: #f0f0f0;
}

.text-edit-menu button i {
    margin-right: 8px;
    width: 16px;
}