/* Custom Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Tool Buttons */
.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #f3f4f6;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #4b5563;
}

.tool-btn:hover {
    background-color: #e5e7eb;
    border-color: #d1d5db;
}

.tool-btn.active {
    background-color: #dbeafe;
    border-color: #3b82f6;
    color: #2563eb;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 1.5rem;
}

/* Canvas Container */
#canvasContainer {
    background: repeating-conic-gradient(#f3f4f6 0% 25%, #e5e7eb 0% 50%) 50% / 20px 20px;
    border-radius: 0.5rem;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mainCanvas {
    background-color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    cursor: crosshair;
}

#mainCanvas.moving {
    cursor: move;
}

/* Drag & Drop Zone */
#dropZone.drag-over {
    background-color: #dcfce7;
    border-color: #22c55e;
    transform: scale(1.02);
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* AP Card */
.ap-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.2s;
}

.ap-card:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Annotation Item */
.annotation-item {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.annotation-item:hover {
    background-color: #f3f4f6;
    border-color: #3b82f6;
}

.annotation-item.selected {
    background-color: #dbeafe;
    border-color: #3b82f6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-content {
        padding: 1rem;
        max-width: 95%;
    }
    
    .tool-btn {
        width: 36px;
        height: 36px;
    }
}

/* Loading Animation */
.loading {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 2000;
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

/* Custom Input Styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background-color: #e5e7eb;
    border-radius: 0.5rem;
    height: 0.5rem;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -4px;
    background-color: #3b82f6;
    border-radius: 50%;
    height: 1rem;
    width: 1rem;
}

input[type="range"]::-moz-range-track {
    background-color: #e5e7eb;
    border-radius: 0.5rem;
    height: 0.5rem;
}

input[type="range"]::-moz-range-thumb {
    background-color: #3b82f6;
    border: none;
    border-radius: 50%;
    height: 1rem;
    width: 1rem;
}

/* Prose Typography */
.prose ul {
    list-style-type: disc;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}
