/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Open Sans', 'Montserrat', sans-serif;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    background-color: #64748b;
    /* Default slate color */
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    gap: 0.5rem;
    margin-left: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* App container layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar styles */
.sidebar {
    width: 320px;
    min-height: 300px;
    background-color: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-my-designs-link {
    padding: 1rem;
}

.sidebar-my-designs-link a {
    text-decoration: none;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
}

.tab-button {
    display: flex;
    flex: 1;
    align-items: center;
    padding: 0.75rem;
    font-weight: 500;
    color: #64748b;
    background-color: #f8fafc;
    transition: all 0.2s;
    cursor: pointer;
}

.tab-button:hover {
    background-color: #f1f5f9;
}

.tab-button.active {
    color: #3b82f6;
    background-color: #fff;
    border-bottom: 2px solid #3b82f6;
}

.tab-button i {
    margin-right: 0.5rem;
}

/* Tab content */
.tab-content {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

.tab-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
}

.tab-pane.active {
    display: flex;
}

/* Chat styles */
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    padding: 0.75rem;
    border-radius: 0.5rem;
    max-width: 85%;
    position: relative;
}

.message p {
    margin-bottom: 0.5rem;
}

.message.user {
    align-self: flex-end;
    background-color: #eff6ff;
    border: 1px solid #dbeafe;
    margin-left: 2rem;
}

.message.assistant {
    align-self: flex-start;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    margin-right: 2rem;
}

.component-preview {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    cursor: move;
    transform: scale(0.75);
    transform-origin: top left;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
}

.chat-input input#message-input {
    flex-grow: 1;
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.chat-input button {
    width: 2.5rem;
    height: 2.5rem;
    background-color: #3b82f6;
    color: #fff;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.chat-input button:hover {
    background-color: #2563eb;
}

/* Loading animation */
.loading-dots {
    display: inline-block;
    width: 20px;
}

/* Component list */
.component-list {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
}

.component-item {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background-color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: move;
    transition: background-color 0.2s, transform 0.1s;
}

.component-item:hover {
    background-color: #f8fafc;
}

.component-item:active {
    transform: scale(0.98);
}

.component-item i {
    width: 1.5rem;
    height: 1.5rem;
    background-color: #dbeafe;
    color: #3b82f6;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Main content area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #f1f5f9;
    overflow: hidden;
}

/* Toolbar */
.toolbar {
    height: 3.5rem;
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.toolbar-button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f1f5f9;
    color: #64748b;
    transition: background-color 0.2s;
}

.toolbar-button:hover {
    background-color: #e2e8f0;
}

.toolbar-button.primary {
    background-color: #3b82f6;
    color: #fff;
}

.toolbar-button.primary:hover {
    background-color: #2563eb;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 10px 0 10px 0;
}

#device-selector {
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

/* Canvas */
.canvas-container {
    flex-grow: 1;
    overflow: auto;
    padding: 2rem;
}

.canvas {
    width: 1000px;
    min-height: 1200px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    transition: width 0.3s ease;
}

/* Properties panel */
.properties-panel {
    width: 300px;
    background-color: #fff;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.properties-panel.active {
    transform: translateX(0);
}

.properties-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.properties-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.close-properties {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.close-properties:hover {
    background-color: #f1f5f9;
}

.properties-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.no-selection-message {
    color: #94a3b8;
    text-align: center;
    padding: 2rem 0;
}

.property-field {
    margin-bottom: 1.25rem;
}

.property-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #475569;
}

.property-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.property-range {
    width: 100%;
    margin-bottom: 0.5rem;
}

.range-value {
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
}

.property-section-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid #e2e8f0;
}

.property-group {
    padding: 0.75rem;
    margin-bottom: 1rem;
    background-color: #f8fafc;
    border-radius: 0.375rem;
}

.property-group h5 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: #64748b;
}

.properties-type-header {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #0f172a;
}

/* Component styles */
.component {
    width: 100%;
    position: relative;
    background-color: #fff;
}

.component.selected {
    outline: 2px solid #3b82f6;
}

.component-controls {
    position: absolute;
    top: -1.5rem;
    right: 0;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.component:hover .component-controls {
    opacity: 1;
}

.component-control-button {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    background-color: #fff;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.component-control-button:hover {
    background-color: #f8fafc;
}

.delete-button {
    color: #ef4444;
}


/* Drag and drop styles */
.dragging {
    opacity: 0.5;
}

.drag-preview {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.8;
    transform: translate(-50%, -50%);
}

.drag-over {
    background-color: rgba(219, 234, 254, 0.5);
}

.snap-line {
    position: absolute;
    background-color: #3b82f6;
    z-index: 100;
    pointer-events: none;
}

.snap-line-horizontal {
    height: 2px;
    left: 0;
    right: 0;
}

.snap-line-vertical {
    width: 2px;
    top: 0;
    bottom: 0;
}

/* Media Queries for Responsive Design */
@media (max-width: 1200px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 50%;
    }

    .properties-panel {
        width: 100%;
        height: 300px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(100%);
    }

    .properties-panel.active {
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .pricing-plans {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

.panel {
    display: none;
    height: 100%;
    overflow-y: auto;
}

.panel.active {
    display: block;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ccc;
}

.tab {
    padding: 10px 15px;
    cursor: pointer;
    background-color: #f0f0f0;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
}

.tab.active {
    background-color: #fff;
    border: 1px solid #ccc;
    border-bottom: none;
}

#components-panel {
    padding: 10px;
}

.component-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    background-color: #fff;
}

.component-preview {
    width: 40px;
    height: 40px;
    background-color: #f5f5f5;
    border-radius: 4px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-icon {
    font-size: 20px;
    color: #666;
}

.hero-icon::before {
    content: "H";
}

.features-icon::before {
    content: "F";
}

.testimonial-icon::before {
    content: "T";
}

.pricing-icon::before {
    content: "P";
}

.cta-icon::before {
    content: "C";
}

.custom-icon::before {
    content: "★";
}

.component-label {
    flex-grow: 1;
    font-size: 14px;
}

.component-actions {
    display: flex;
}

.add-component-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-components {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Add these styles for editable text elements */

.editable-text {
    cursor: text;
    transition: background-color 0.2s;
    position: relative;
}

.editable-text:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.editable-text:hover::after {
    content: "✏️";
    font-size: 12px;
    position: absolute;
    top: -5px;
    right: -5px;
    background: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
}

.editable-text.editing {
    background-color: rgba(0, 123, 255, 0.05);
    outline: none;
    border: none;
    padding: 0;
}

.inline-editor {
    width: 100%;
    resize: both;
    font-family: inherit;
    outline: none;
}

/* Add these styles for file upload functionality */

.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #f9f9f9;
    align-items: center;
}

.file-upload-container {
    display: flex;
    align-items: center;
    margin-right: 5px;
}

.upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.upload-button:hover {
    background-color: #e0e0e0;
}

.file-preview {
    display: flex;
    max-width: 32px;
    height: 32px;
    overflow: hidden;
}

.file-preview img {
    max-height: 32px;
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.file-preview .file-info {
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

.file-preview .file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.file-preview .remove-file {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    margin-left: 5px;
}

.message .reference-image {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    margin-top: 8px;
    border: 1px solid #ddd;
}

.message .reference-pdf {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-top: 8px;
}

.message .reference-pdf i {
    color: #e74c3c;
    margin-right: 8px;
}

/* Add to your styles.css file */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.share-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.share-url-container {
    display: flex;
    margin: 15px 0;
}

.share-url-container input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.share-url-container button {
    padding: 8px 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

#close-share-modal {
    padding: 8px 15px;
    background-color: #f5f5f5;
    color: black;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 10px;
    cursor: pointer;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Add to your CSS file */
.user-auth-container {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.user-profile {
    display: flex;
    align-items: center;
    background: white;
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.profile-pic {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.login-btn,
.logout-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #4285F4;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
}

.logout-btn {
    background: #757575;
    margin-left: 10px;
    font-size: 12px;
    padding: 4px 8px;
}

/* Add this to your main CSS file */
.designs-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    background-color: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding: 0;
    border-left: 1px solid #ddd;
}

.sidebar-visible {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: #f8f8f8;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #555;
}

.sidebar-content {
    padding: 15px;
}

.designs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.design-card {
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #eee;
    transition: all 0.2s ease;
    background-color: #fafafa;
}

.design-card:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.design-card h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.design-card p {
    margin: 0 0 12px 0;
    font-size: 12px;
    color: #777;
}

.design-link {
    display: inline-block;
    padding: 6px 12px;
    background-color: #4285F4;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.design-link:hover {
    background-color: #3367d6;
}

.sidebar-toggle-btn {
    margin-left: 10px;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background-color: #e5e5e5;
}

.loading,
.error {
    text-align: center;
    color: #666;
    font-style: italic;
}

.error {
    color: #d32f2f;
}

/* Add to your styles.css */
.style-selector {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.style-selector label {
    margin-right: 8px;
    font-weight: 500;
}

.style-selector select {
    padding: 0.65rem 1rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #fff;
    line-height: 1.5;
}

/* Enhanced Responsive Design - Add after existing media queries */

/* Base responsive improvements */
html,
body {
    overflow-x: hidden;
    /* Prevent horizontal scrolling */
}

.canvas {
    width: 100%;
    /* Make canvas responsive */
    max-width: 1000px;
    /* Keep maximum size */
    min-height: 800px;
    /* Reduce minimum height on small screens */
}

/* Tablet and smaller screens */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .main-content {
        height: auto;
        flex-grow: 1;
        min-height: 60vh;
    }

    .canvas {
        min-height: 600px;
    }

    .toolbar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
        margin: 5px 0;
    }

    .properties-panel {
        width: 100%;
        height: 300px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(100%);
    }

    .properties-panel.active {
        transform: translateY(0);
    }
}

/* Mobile devices */
@media (max-width: 768px) {

    .toolbar-button,
    .action-button {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    .toolbar-button i,
    .action-button i {
        margin-right: 4px;
    }

    .toolbar {
        gap: 5px;
    }

    .chat-input {
        padding: 8px;
    }

    .chat-input input {
        padding: 8px;
        font-size: 14px;
    }

    .canvas-container {
        padding: 10px;
    }

    .canvas {
        min-height: 500px;
    }

    /* Adjust modal layout */
    .modal-content {
        padding: 15px;
        width: 95%;
        margin: 0 auto;
    }

    /* Component styles for mobile */
    .features-component .features-grid {
        grid-template-columns: 1fr;
    }

    .pricing-component .pricing-plans {
        grid-template-columns: 1fr;
    }

    /* Improve drag controls on mobile */
    .component-controls {
        top: -2.5rem;
        opacity: 1;
    }

    .component-control-button {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .sidebar-header h1 {
        font-size: 1.1rem;
    }

    .tab-button {
        padding: 8px 5px;
        font-size: 0.8rem;
    }

    .tab-button i {
        margin-right: 3px;
    }

    .chat-messages {
        padding: 8px;
    }

    .message {
        padding: 8px;
        max-width: 95%;
    }

    .user-auth-container {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 10px;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .style-selector select,
    #device-selector {
        max-width: 100px;
    }

    /* Make buttons touch-friendly */
    button,
    .toolbar-button,
    .action-button {
        min-height: 36px;
        min-width: 36px;
    }

    /* Stack modal buttons on small screens */
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions button {
        width: 100%;
    }
}

/* Fix for modals on all screen sizes */
.modal {
    padding: 10px;
}

.modal-content {
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Better component resizing */
.canvas-component {
    box-sizing: border-box;
    max-width: 100% !important;
}

/* Improve form elements responsiveness */
.form-group input,
.form-group select,
.form-group textarea {
    max-width: 100%;
    box-sizing: border-box;
}

/* Touch-friendly drag handles */
.element-drag-handle {
    min-width: 20px;
    min-height: 20px;
}

/* ...existing code... */

/* Canvas */
.canvas-container {
    flex-grow: 1;
    overflow: auto;
    padding: 2rem;
    transition: padding 0.3s ease;
}

.canvas {
    width: 1000px;
    min-height: 1200px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    transition: all 0.3s ease;
    /* Changed from width-only to all properties */
    transform-origin: center top;
}

/* Add a resize observer class that will be added during layout refreshes */
.canvas-refreshing {
    opacity: 0.98;
}

/* Enhanced Responsive Design - Add after existing media queries */
/* ...existing code... */

/* Improve responsiveness during resize */
@media (max-width: 1024px) {
    .canvas-container {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .canvas-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .canvas-container {
        padding: 0.5rem;
    }
}

/* ...existing code... */

/* Action Button Styles */
.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    background-color: #64748b;
    /* Default slate color */
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    gap: 0.5rem;
    margin-left: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.action-button:hover {
    background-color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.action-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.action-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.25);
}

.action-button i,
.action-button .fas,
.action-button .far,
.action-button .fab {
    font-size: 1rem;
}

/* Variant colors */
.action-button.primary {
    background-color: #3b82f6;
}

.action-button.primary:hover {
    background-color: #2563eb;
}

.action-button.primary:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.action-button.success {
    background-color: #10b981;
}

.action-button.success:hover {
    background-color: #059669;
}

.action-button.success:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.action-button.warning {
    background-color: #f59e0b;
}

.action-button.warning:hover {
    background-color: #d97706;
}

.action-button.warning:focus {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.action-button.danger {
    background-color: #ef4444;
}

.action-button.danger:hover {
    background-color: #dc2626;
}

.action-button.danger:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.action-button.info {
    background-color: #0ea5e9;
}

.action-button.info:hover {
    background-color: #0284c7;
}

.action-button.info:focus {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

/* Size variants */
.action-button.small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

.action-button.large {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.5rem;
}

/* Icon-only buttons */
.action-button.icon-only {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 0.375rem;
    justify-content: center;
    align-items: center;
}

.action-button.icon-only.small {
    width: 2rem;
    height: 2rem;
}

.action-button.icon-only.large {
    width: 3rem;
    height: 3rem;
}

/* Outline style */
.action-button.outline {
    background-color: transparent;
    border: 1px solid #64748b;
    color: #64748b;
}

.action-button.outline:hover {
    background-color: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.action-button.outline.primary {
    border-color: #3b82f6;
    color: #3b82f6;
}

.action-button.outline.primary:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.action-button.outline.success {
    border-color: #10b981;
    color: #10b981;
}

.action-button.outline.success:hover {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
}

/* Disabled state */
.action-button:disabled,
.action-button.disabled {
    opacity: 0.65;
    pointer-events: none;
    cursor: not-allowed;
}

/* Loading state */
.action-button.loading {
    position: relative;
    color: transparent !important;
}

.action-button.loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: calc(50% - 0.5rem);
    left: calc(50% - 0.5rem);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: white;
    border-radius: 50%;
    animation: button-loading-spinner 0.6s linear infinite;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }

    to {
        transform: rotate(1turn);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .action-button {
        padding: 0.5rem 1rem;
    }

    .action-button.large {
        padding: 0.625rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .action-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    /* Make buttons full width on very small screens */
    .action-button.mobile-full {
        display: flex;
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* For Alpha Tooltip */
.alpha-tag {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip {
    visibility: hidden;
    width: 300px;
    background-color: #555;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    top: 100%;
    left: 50%;
    margin-left: -150px;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.5;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #555 transparent;
}

.alpha-tag:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

#screen-loading {
    width: 100%;
    height: 100%;
    background-color: #fff;
    opacity: 0.75;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1100;
    text-align: center;
    padding-top: 35vh;
}

#screen-loading img {
    width: 100%;
}

.mb-5 {
    margin-bottom: 5px;
}
.mb-10 {
    margin-bottom: 10px;
}
.mb-20 {
    margin-bottom: 20px;
}

.text-center {
    text-align: center;
}

/* Input related styling */
.custom-input {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #c7c7c7;
    width: 100%;
}
.custom-label {
    font-size: 12px;
}
.custom-button-blue {
    background-color: #0d6efd;
}
.custom-button-red {
    background-color: #dc3545;
}
.custom-button-yellow {
    background-color: #ffc107;
}
.custom-button-green {
    background-color: #198754;
}
.styled-checkbox {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.styled-checkbox input {
  display: none;
}
.styled-checkbox span {
  width: 24px;
  height: 24px;
  border: 2px solid #555;
  border-radius: 4px;
  display: inline-block;
  margin-right: 8px;
  position: relative;
}
.styled-checkbox input:checked + span::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 1px;
  width: 6px;
  height: 12px;
  border: solid #333;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}


/* Save dialog box */
#save-dialog-box {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(64, 64, 64, 0.75);
    z-index: 9999;
    display: flex;
    justify-content: center; /* centers horizontally */
    align-items: center;     /* centers vertically */
}
#save-dialog-box-content {
    width: 50%;
    background-color: #ffffff;
    border: 1px solid #ebebeb;
    padding: 10px;
    border-radius: 10px;
}