/* AMOC STL Designer Styles */
/* Built upon the existing viewer styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.2rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    gap: 15px;
}

/* Button Styles */
.primary-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.primary-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-button {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.secondary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.danger-button {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.danger-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Creation Controls */
.creation-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.creation-section, .upload-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.creation-section h3, .upload-section h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.creation-form, .upload-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-group input, .form-group select {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dimension-inputs {
    margin-top: 10px;
}

.dimension-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 10px;
}

.upload-status {
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.upload-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.upload-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* STL List Container */
.stl-list-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 30px;
    overflow: hidden;
}

.stl-list-container h3 {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    padding: 15px 25px;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

#stl-count {
    font-weight: 400;
    opacity: 0.8;
}

.stl-list {
    max-height: 300px;
    overflow-y: auto;
}
.main-content {
    display: grid;
    grid-template-columns: 1fr 640px;
    gap: 30px;
    margin-bottom: 30px;
}

/* Update existing STL item styles */
.stl-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
}

.stl-item:hover {
    background-color: #f8f9fa;
}

.stl-item:last-child {
    border-bottom: none;
}

.stl-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.stl-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.stl-info {
    flex: 1;
}

.stl-name {
    font-weight: 600;
    color: #495057;
    font-size: 16px;
    margin-bottom: 2px;
}

.stl-details {
    font-size: 12px;
    color: #6c757d;
}
.stl-actions {
    display: flex;
    gap: 8px;
}

.action-button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.move-button {
    background: #17a2b8;
    color: white;
}

.move-button:hover {
    background: #138496;
}

.download-button {
    background: #28a745;
    color: white;
}

.download-button:hover {
    background: #218838;
}

.delete-button {
    background: #dc3545;
    color: white;
}

.delete-button:hover {
    background: #c82333;
}

/* 3D Viewer */
.viewer-container {
    width: 100%;
    height: 600px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
    background: #fff;
    margin-bottom: 20px;
    position: relative;
}

/* View Controls */
.view-controls {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.view-options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.view-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
}

.view-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Status Messages */
.status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.status-message.show {
    transform: translateX(0);
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #cce7ff;
    color: #004085;
    border: 1px solid #b3d9ff;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

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

#loading-text {
    font-size: 16px;
    font-weight: 500;
    color: #495057;
}

/* Loading indicator for STL viewer */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    z-index: 100;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state h4 {
    margin-bottom: 10px;
    color: #495057;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .creation-controls {
        grid-template-columns: 1fr;
    }
    
    .dimension-group {
        grid-template-columns: 1fr;
    }
    
    .stl-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stl-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-right {
        justify-content: center;
    }
    
    .viewer-container {
        height: 400px;
    }
    
    .view-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Custom scrollbar */
.stl-list::-webkit-scrollbar {
    width: 8px;
}

.stl-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.stl-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.stl-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}
/* Centralized Actions Panel */
.actions-panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    padding: 25px;
    height: fit-content;
}

.actions-panel h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.selected-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

.action-selector {
    margin-bottom: 20px;
}

.action-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.action-selector select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
}

/* Action-specific controls */
.action-controls {
    margin-bottom: 20px;
    min-height: 120px;
}

.action-controls.hidden {
    display: none;
}

.move-controls, .scale-controls {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.coordinate-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.coordinate-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.coordinate-input label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.coordinate-input input {
    padding: 8px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.scale-input {
    margin-bottom: 15px;
}

.scale-input label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.scale-input input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
}

/* Updated opacity control for centralized panel */
.opacity-control {
    margin-bottom: 20px;
}

.opacity-control label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.opacity-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    cursor: pointer;
    margin-bottom: 5px;
}

.opacity-value {
    text-align: center;
    font-size: 14px;
    color: #6c757d;
}

/* Action buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.execute-button {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.execute-button:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-1px);
}

.execute-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.bulk-actions {
    display: flex;
    gap: 10px;
}

.bulk-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-selected {
    background: #28a745;
    color: white;
}

.download-selected:hover:not(:disabled) {
    background: #218838;
}

.delete-selected {
    background: #dc3545;
    color: white;
}

.delete-selected:hover:not(:disabled) {
    background: #c82333;
}

.bulk-actions button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Remove old individual STL control styles that are no longer needed */
.stl-controls {
    display: none; /* Hide old individual controls */
}
/* 
.scale-controls {
    display: none; 
} */
.rotate-controls, .merge-controls {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.merge-info {
    background: #e8f4fd;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #2196f3;
}

.merge-info p {
    margin: 0;
    font-size: 14px;
    color: #495057;
}

.merge-info small {
    color: #6c757d;
    font-style: italic;
}

.merge-input {
    margin-bottom: 15px;
}

.merge-input label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.merge-input input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
}
.subtract-controls {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.subtract-info {
    background: #fff3e0;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #ff9800;
}

.subtract-info p {
    margin: 0;
    font-size: 14px;
    color: #495057;
}

.subtract-info small {
    color: #6c757d;
    font-style: italic;
}

.subtract-input {
    margin-bottom: 15px;
}

.subtract-input label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.subtract-input input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
}

#execute-subtract {
    background: #ff9800;
}

#execute-subtract:hover:not(:disabled) {
    background: #f57c00;
}

.action-controls[data-active="subtract"] .subtract-controls {
    border-left: 4px solid #ff9800;
}
/* Rotate-specific styling */
.coordinate-input input[type="number"][id^="rotate-"] {
    background: #fff3cd;
    border-color: #ffc107;
}

.coordinate-input input[type="number"][id^="rotate-"]:focus {
    border-color: #ff8b07;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.25);
}

/* Enhanced execute button styling */
.execute-button {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.execute-button:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.execute-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Action-specific button colors */
#execute-rotate {
    background: #fd7e14;
}

#execute-rotate:hover:not(:disabled) {
    background: #e8690b;
}

#execute-merge {
    background: #6f42c1;
}

#execute-merge:hover:not(:disabled) {
    background: #5a32a3;
}

/* Visual feedback for different actions */
.action-controls[data-active="move"] .move-controls {
    border-left: 4px solid #17a2b8;
}

.action-controls[data-active="rotate"] .rotate-controls {
    border-left: 4px solid #fd7e14;
}

.action-controls[data-active="scale"] .scale-controls {
    border-left: 4px solid #28a745;
}

.action-controls[data-active="merge"] .merge-controls {
    border-left: 4px solid #6f42c1;
}


/* Responsive updates for new layout */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .coordinate-inputs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .bulk-actions {
        flex-direction: column;
    }

    .coordinate-inputs {
        grid-template-columns: 1fr;
    }
}