/* MR2DCad Custom Styles */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #161b22;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* Canvas cursor styles */
#cad-canvas {
    cursor: crosshair;
}

#cad-canvas.pan-mode {
    cursor: grab;
}

#cad-canvas.panning {
    cursor: grabbing;
}

#cad-canvas.select-mode {
    cursor: default;
}

/* Tool button active state */
.tool-btn.active {
    background-color: rgba(88, 166, 255, 0.3);
    color: #58a6ff;
}

/* Document card styles */
.document-card {
    transition: all 0.2s ease;
}

.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.document-card .card-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.document-card:hover .card-actions {
    opacity: 1;
}

/* Modal animations */
#modal-overlay {
    transition: opacity 0.2s ease;
}

#modal-overlay.show {
    opacity: 1;
}

#modal-content {
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

#modal-overlay.show #modal-content {
    transform: scale(1);
}

/* Context menu */
#context-menu {
    min-width: 160px;
}

.context-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.15s ease;
}

.context-menu-item:hover {
    background-color: #30363d;
}

.context-menu-item.danger {
    color: #f85149;
}

.context-menu-item.danger:hover {
    background-color: rgba(248, 81, 73, 0.1);
}

.context-menu-divider {
    height: 1px;
    background-color: #30363d;
    margin: 4px 0;
}

/* Input styles */
input[type="text"],
input[type="number"] {
    outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

/* Color input styling */
input[type="color"] {
    -webkit-appearance: none;
    border: 1px solid #30363d;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* Checkbox styling */
input[type="checkbox"] {
    accent-color: #58a6ff;
}

/* Save status animation */
#save-status {
    transition: color 0.3s ease;
}

#save-status.saving {
    color: #f0883e;
}

#save-status.saved {
    color: #3fb950;
}

/* Grid overlay pattern */
.grid-pattern {
    background-image: 
        linear-gradient(rgba(88, 166, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 166, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Selection highlight */
.selected-element {
    stroke: #58a6ff !important;
    stroke-width: 2px;
}

/* Tooltip styles */
[title] {
    position: relative;
}

/* Keyboard shortcut hints */
.shortcut-hint {
    font-size: 0.75rem;
    color: #8b949e;
    margin-left: 8px;
}

/* Loading spinner */
.spinner {
    border: 2px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .tool-btn {
        padding: 6px;
    }
    
    .tool-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Print styles */
@media print {
    #document-manager,
    header,
    .toolbar {
        display: none !important;
    }
    
    #canvas-container {
        position: static !important;
        overflow: visible !important;
    }
    
    #cad-canvas {
        position: static !important;
    }
}
