/* Devisi Customise Product - Frontend Styles */

/* Botón Personalizar */
.devisi-customize-btn {
    display: inline-block;
    padding: 12px 24px;
    margin: 10px 0;
    background-color: #0073aa;
    color: black;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.devisi-customize-btn:hover {
    background-color: #005a87;
}

.devisi-customize-btn:active {
    background-color: #004a6f;
}

/* Modal de Personalización */
.devisi-customizer-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.devisi-customizer-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.devisi-customizer-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header del Modal */
.devisi-customizer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
    background-color: #f9f9f9;
}

.devisi-customizer-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.devisi-style-btn {
    color: black;
}

.devisi-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.devisi-close-btn:hover {
    color: #333;
}

/* Body del Modal */
.devisi-customizer-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Panel de Herramientas */
.devisi-tools-panel {
    width: 280px;
    background-color: #f5f5f5;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    padding: 20px;
}

.devisi-tool-section {
    margin-bottom: 25px;
}

.devisi-tool-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
}

.devisi-tool-group {
    margin-bottom: 15px;
}

.devisi-tool-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: 6px;
}

.devisi-tool-group input[type="text"],
.devisi-tool-group input[type="number"],
.devisi-tool-group input[type="color"],
.devisi-tool-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
    background-color: white;
}

.devisi-tool-group input[type="color"] {
    height: 38px;
    cursor: pointer;
}

.devisi-tool-group input:focus,
.devisi-tool-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.devisi-button-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.devisi-button-group button {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.devisi-button-group button:hover {
    background-color: #f0f0f0;
    border-color: #0073aa;
}

.devisi-button-group button.active {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Canvas Principal */
.devisi-canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fafafa;
    padding: 20px;
    overflow: hidden;
}

.devisi-canvas-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.devisi-canvas-tab {
    padding: 10px 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.devisi-canvas-tab.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

.devisi-canvas-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#devisi-canvas {
    max-width: 100%;
    max-height: 100%;
    border: 1px solid #ddd;
    cursor: crosshair;
}

/* Footer del Modal */
.devisi-customizer-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    background-color: #f9f9f9;
}

.devisi-footer-btn {
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.devisi-footer-btn.cancel {
    background-color: white;
    color: #333;
}

.devisi-footer-btn.cancel:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

.devisi-footer-btn.save {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

.devisi-footer-btn.save:hover {
    background-color: #005a87;
    border-color: #005a87;
}

.devisi-footer-btn:active {
    transform: scale(0.98);
}

/* Input de Archivo */
.devisi-file-input {
    display: none;
}

.devisi-file-input-label {
    display: inline-block;
    padding: 10px 15px;
    background-color: #0073aa;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.devisi-file-input-label:hover {
    background-color: #005a87;
}

/* Spinner de Carga */
.devisi-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: devisiSpin 1s linear infinite;
    margin: 10px auto;
}

.devisi-spinner.active {
    display: block;
}

@keyframes devisiSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mensajes */
.devisi-message {
    display: none;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 10px;
    animation: slideDown 0.3s ease;
}

.devisi-message.show {
    display: block;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.devisi-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.devisi-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.devisi-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive */
@media (max-width: 768px) {
    .devisi-customizer-content {
        width: 100%;
        height: 100vh;
        max-width: none;
        border-radius: 0;
    }

    .devisi-customizer-body {
        flex-direction: column;
    }

    .devisi-tools-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
        max-height: 200px;
    }

    .devisi-canvas-container {
        padding: 10px;
    }
}

/* Draggable Elements */
.devisi-draggable {
    cursor: move;
    transition: all 0.2s ease;
}

.devisi-draggable:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Controles Fabric */
.fabric-text-editing .fabric-text {
    box-shadow: inset 0 0 0 2px #0073aa;
}

.canvas-container {
    border: 1px solid #ddd !important;
    border-radius: 4px;
}
